OptaPlanner core 6.0.1.Final

org.optaplanner.core.impl.heuristic.selector.move.factory
Interface MoveIteratorFactory


public interface MoveIteratorFactory

An interface to generate an Iterator of custom Moves.

For a more simple version, see MoveListFactory.


Method Summary
 Iterator<Move> createOriginalMoveIterator(ScoreDirector scoreDirector)
          When it is called depends on the configured SelectionCacheType.
 Iterator<Move> createRandomMoveIterator(ScoreDirector scoreDirector, Random workingRandom)
          When it is called depends on the configured SelectionCacheType.
 long getSize(ScoreDirector scoreDirector)
           
 

Method Detail

getSize

long getSize(ScoreDirector scoreDirector)
Parameters:
scoreDirector - never null, the ScoreDirector which has the ScoreDirector.getWorkingSolution() of which the Moves need to be generated
Returns:
the approximate number of elements generated by createOriginalMoveIterator(ScoreDirector)
Throws:
UnsupportedOperationException - if not supported

createOriginalMoveIterator

Iterator<Move> createOriginalMoveIterator(ScoreDirector scoreDirector)
When it is called depends on the configured SelectionCacheType.

Parameters:
scoreDirector - never null, the ScoreDirector which has the ScoreDirector.getWorkingSolution() of which the Moves need to be generated
Returns:
never null, an Iterator that will end sooner or later
Throws:
UnsupportedOperationException - if only createRandomMoveIterator(ScoreDirector, Random) is supported

createRandomMoveIterator

Iterator<Move> createRandomMoveIterator(ScoreDirector scoreDirector,
                                        Random workingRandom)
When it is called depends on the configured SelectionCacheType.

Parameters:
scoreDirector - never null, the ScoreDirector which has the ScoreDirector.getWorkingSolution() of which the Moves need to be generated
workingRandom - never null, the Random to use when any random number is needed, so EnvironmentMode.REPRODUCIBLE works correctly
Returns:
never null, an Iterator that is allowed (or even presumed) to be never ending
Throws:
UnsupportedOperationException - if only createOriginalMoveIterator(ScoreDirector) is supported

OptaPlanner core 6.0.1.Final

Copyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.