Interface MoveIteratorFactory<Solution_,Move_ extends Move<Solution_>>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
public interface MoveIteratorFactory<Solution_,Move_ extends Move<Solution_>>An interface to generate anIteratorof customMoves.For a more simple version, see
MoveListFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Iterator<Move_>createOriginalMoveIterator(ScoreDirector<Solution_> scoreDirector)When it is called depends on the configuredSelectionCacheType.Iterator<Move_>createRandomMoveIterator(ScoreDirector<Solution_> scoreDirector, Random workingRandom)When it is called depends on the configuredSelectionCacheType.longgetSize(ScoreDirector<Solution_> scoreDirector)default voidphaseEnded(ScoreDirector<Solution_> scoreDirector)Called when the phase (for example Local Search) ends, to clean up anything cached sincephaseStarted(ScoreDirector).default voidphaseStarted(ScoreDirector<Solution_> scoreDirector)Called when the phase (for example Local Search) starts.
-
-
-
Method Detail
-
phaseStarted
default void phaseStarted(ScoreDirector<Solution_> scoreDirector)
Called when the phase (for example Local Search) starts.- Parameters:
scoreDirector- never null
-
phaseEnded
default void phaseEnded(ScoreDirector<Solution_> scoreDirector)
Called when the phase (for example Local Search) ends, to clean up anything cached sincephaseStarted(ScoreDirector).- Parameters:
scoreDirector- never null
-
getSize
long getSize(ScoreDirector<Solution_> scoreDirector)
- Parameters:
scoreDirector- never null, theScoreDirectorwhich has theScoreDirector.getWorkingSolution()of which theMoves need to be generated- Returns:
- the approximate number of elements generated by
createOriginalMoveIterator(ScoreDirector) - Throws:
UnsupportedOperationException- if not supported
-
createOriginalMoveIterator
Iterator<Move_> createOriginalMoveIterator(ScoreDirector<Solution_> scoreDirector)
When it is called depends on the configuredSelectionCacheType.- Parameters:
scoreDirector- never null, theScoreDirectorwhich has theScoreDirector.getWorkingSolution()of which theMoves need to be generated- Returns:
- never null, an
Iteratorthat will end sooner or later - Throws:
UnsupportedOperationException- if onlycreateRandomMoveIterator(ScoreDirector, Random)is supported
-
createRandomMoveIterator
Iterator<Move_> createRandomMoveIterator(ScoreDirector<Solution_> scoreDirector, Random workingRandom)
When it is called depends on the configuredSelectionCacheType.- Parameters:
scoreDirector- never null, theScoreDirectorwhich has theScoreDirector.getWorkingSolution()of which theMoves need to be generatedworkingRandom- never null, theRandomto use when any random number is needed, soEnvironmentMode.REPRODUCIBLEworks correctly- Returns:
- never null, an
Iteratorthat is allowed (or even presumed) to be never ending - Throws:
UnsupportedOperationException- if onlycreateOriginalMoveIterator(ScoreDirector)is supported
-
-