Examples of MoveSelector


Examples of org.optaplanner.core.impl.heuristic.selector.move.MoveSelector

        return valueSelector;
    }

    public static MoveSelector mockMoveSelector(Class moveClass,
            Move... moves) {
        MoveSelector moveSelector = mock(MoveSelector.class);
        final List<Move> moveList = Arrays.<Move>asList(moves);
        when(moveSelector.iterator()).thenAnswer(new Answer<Iterator<Move>>() {
            public Iterator<Move> answer(InvocationOnMock invocation) throws Throwable {
                return moveList.iterator();
            }
        });
        when(moveSelector.isCountable()).thenReturn(true);
        when(moveSelector.isNeverEnding()).thenReturn(false);
        when(moveSelector.getCacheType()).thenReturn(SelectionCacheType.JUST_IN_TIME);
        when(moveSelector.getSize()).thenReturn((long) moveList.size());
        return moveSelector;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.