public class UnionMoveSelector extends CompositeMoveSelector
CompositeMoveSelector
that unions 2 or more MoveSelector
s.
For example: a union of {A, B, C} and {X, Y} will result in {A, B, C, X, Y}.
Warning: there is no duplicated Move
check, so union of {A, B, C} and {B, D} will result in {A, B, C, B, D}.
CompositeMoveSelector
Modifier and Type | Class and Description |
---|---|
class |
UnionMoveSelector.RandomUnionMoveIterator |
Modifier and Type | Field and Description |
---|---|
protected ScoreDirector |
scoreDirector |
protected SelectionProbabilityWeightFactory |
selectorProbabilityWeightFactory |
childMoveSelectorList, randomSelection
logger, phaseLifecycleSupport, workingRandom
Constructor and Description |
---|
UnionMoveSelector(List<MoveSelector> childMoveSelectorList,
boolean randomSelection) |
UnionMoveSelector(List<MoveSelector> childMoveSelectorList,
boolean randomSelection,
SelectionProbabilityWeightFactory selectorProbabilityWeightFactory) |
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 |
isNeverEnding()
Is true if
Selector.isCountable() is false
or if this selector is in random order (for most cases). |
Iterator<Move> |
iterator() |
void |
stepEnded(AbstractStepScope stepScope) |
void |
stepStarted(AbstractStepScope stepScope) |
String |
toString() |
getChildMoveSelectorList, isCountable, supportsPhaseAndSolverCaching
getCacheType, phaseEnded, phaseStarted, solvingEnded, solvingStarted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCacheType
phaseEnded, phaseStarted
solvingEnded, solvingStarted
forEach, spliterator
protected final SelectionProbabilityWeightFactory selectorProbabilityWeightFactory
protected ScoreDirector scoreDirector
public UnionMoveSelector(List<MoveSelector> childMoveSelectorList, boolean randomSelection)
public UnionMoveSelector(List<MoveSelector> childMoveSelectorList, boolean randomSelection, SelectionProbabilityWeightFactory selectorProbabilityWeightFactory)
public void stepStarted(AbstractStepScope stepScope)
stepStarted
in interface PhaseLifecycleListener
stepStarted
in class AbstractSelector
public void stepEnded(AbstractStepScope stepScope)
stepEnded
in interface PhaseLifecycleListener
stepEnded
in class AbstractSelector
public boolean isNeverEnding()
Selector
Selector.isCountable()
is false
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 (except when it's empty).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 >= 0
public String toString()
toString
in class CompositeMoveSelector
Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.