Interface MoveIteratorFactory<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
public interface MoveIteratorFactory<Solution_>
An interface to generate anIterator
of customMove
s.For a more simple version, see
MoveListFactory
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterator<? extends Move<Solution_>>
createOriginalMoveIterator(ScoreDirector<Solution_> scoreDirector)
When it is called depends on the configuredSelectionCacheType
.Iterator<? extends Move<Solution_>>
createRandomMoveIterator(ScoreDirector<Solution_> scoreDirector, Random workingRandom)
When it is called depends on the configuredSelectionCacheType
.long
getSize(ScoreDirector<Solution_> scoreDirector)
-
-
-
Method Detail
-
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<? extends Move<Solution_>> 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<? extends Move<Solution_>> 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
-
-