Interface MoveIteratorFactory<Solution_,Move_ extends Move<Solution_>>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
public interface MoveIteratorFactory<Solution_,Move_ extends Move<Solution_>>
An interface to generate anIterator
of customMove
s.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
.long
getSize(ScoreDirector<Solution_> scoreDirector)
default void
phaseEnded(ScoreDirector<Solution_> scoreDirector)
Called when the phase (for example Local Search) ends, to clean up anything cached sincephaseStarted(ScoreDirector)
.default void
phaseStarted(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, theScoreDirector
which has theScoreDirector.getWorkingSolution()
of which theMove
s 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, theScoreDirector
which has theScoreDirector.getWorkingSolution()
of which theMove
s need to be generated- Returns:
- never null, an
Iterator
that 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, theScoreDirector
which has theScoreDirector.getWorkingSolution()
of which theMove
s need to be generatedworkingRandom
- never null, theRandom
to use when any random number is needed, soEnvironmentMode.REPRODUCIBLE
works correctly- Returns:
- never null, an
Iterator
that is allowed (or even presumed) to be never ending - Throws:
UnsupportedOperationException
- if onlycreateOriginalMoveIterator(ScoreDirector)
is supported
-
-