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 an
Iterator of custom Moves.
For a more simple version, see MoveListFactory.
-
Method Summary
Modifier and TypeMethodDescriptionadaptIterator(Iterator<Move<Solution_>> moveIterator) createOriginalMoveIterator(ScoreDirector<Solution_> scoreDirector) When it is called depends on the configuredSelectionCacheType.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 Details
-
adaptIterator
-
phaseStarted
Called when the phase (for example Local Search) starts.- Parameters:
scoreDirector- never null
-
phaseEnded
Called when the phase (for example Local Search) ends, to clean up anything cached sincephaseStarted(ScoreDirector).- Parameters:
scoreDirector- never null
-
getSize
- 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
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.PHASE_ASSERTworks correctly- Returns:
- never null, an
Iteratorthat is allowed (or even presumed) to be never ending - Throws:
UnsupportedOperationException- if onlycreateOriginalMoveIterator(ScoreDirector)is supported
-