org.optaplanner.core.impl.heuristic.selector.move.generic
public class SwapMoveSelector extends GenericMoveSelector
Modifier and Type | Field and Description |
---|---|
protected boolean |
anyChained |
protected EntitySelector |
leftEntitySelector |
protected boolean |
randomSelection |
protected EntitySelector |
rightEntitySelector |
protected Collection<PlanningVariableDescriptor> |
variableDescriptors |
logger, solverPhaseLifecycleSupport, workingRandom
Constructor and Description |
---|
SwapMoveSelector(EntitySelector leftEntitySelector,
EntitySelector rightEntitySelector,
Collection<PlanningVariableDescriptor> variableDescriptors,
boolean randomSelection) |
Modifier and Type | Method and Description |
---|---|
long |
getSize()
A random JIT
Selector with Selector.isNeverEnding() true should return a size
as if it would be able to return each distinct element only once,
because the size can be used in SelectionProbabilityWeightFactory . |
boolean |
isContinuous()
If true, then
Selector.isNeverEnding() is also true. |
boolean |
isNeverEnding()
Is true if
Selector.isContinuous() is true
or if this selector is in random order (for most cases). |
Iterator<Move> |
iterator() |
String |
toString() |
getCacheType, phaseEnded, phaseStarted, solvingEnded, solvingStarted, stepEnded, stepStarted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCacheType
phaseEnded, phaseStarted, stepEnded, stepStarted
solvingEnded, solvingStarted
protected final EntitySelector leftEntitySelector
protected final EntitySelector rightEntitySelector
protected final Collection<PlanningVariableDescriptor> variableDescriptors
protected final boolean randomSelection
protected final boolean anyChained
public SwapMoveSelector(EntitySelector leftEntitySelector, EntitySelector rightEntitySelector, Collection<PlanningVariableDescriptor> variableDescriptors, boolean randomSelection)
public boolean isContinuous()
Selector
Selector.isNeverEnding()
is also true.public boolean isNeverEnding()
Selector
Selector.isContinuous()
is true
or if this selector is in random order (for most cases).
Is never true when this selector is in shuffled order (which is less scalable but more exact).Iterator.hasNext()
of the Iterator
created by Iterable.iterator()
never returns false.public long getSize()
IterableSelector
Selector
with Selector.isNeverEnding()
true should return a size
as if it would be able to return each distinct element only once,
because the size can be used in SelectionProbabilityWeightFactory
.Selector
, always >= 0Copyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.