assertSame(baseMoveSelector, ((CachingMoveSelector) moveSelector).getChildMoveSelector());
}
@Test
public void stepOriginal() {
final MoveSelector baseMoveSelector = SelectorTestUtils.mockMoveSelector(DummyMove.class);
MoveSelectorConfig moveSelectorConfig = new MoveSelectorConfig() {
@Override
protected MoveSelector buildBaseMoveSelector(
HeuristicConfigPolicy configPolicy,
SelectionCacheType minimumCacheType, boolean randomSelection) {
assertEquals(SelectionCacheType.STEP, minimumCacheType);
assertEquals(false, randomSelection);
return baseMoveSelector;
}
};
moveSelectorConfig.setCacheType(SelectionCacheType.STEP);
moveSelectorConfig.setSelectionOrder(SelectionOrder.ORIGINAL);
MoveSelector moveSelector = moveSelectorConfig.buildMoveSelector(
buildHeuristicConfigPolicy(),
SelectionCacheType.JUST_IN_TIME, SelectionOrder.RANDOM);
assertInstanceOf(CachingMoveSelector.class, moveSelector);
assertNotInstanceOf(ShufflingMoveSelector.class, moveSelector);
assertEquals(SelectionCacheType.STEP, moveSelector.getCacheType());
assertSame(baseMoveSelector, ((CachingMoveSelector) moveSelector).getChildMoveSelector());
}