public class UnionMoveSelector extends CompositeMoveSelector
CompositeMoveSelector that unions 2 or more MoveSelectors.
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, randomSelectionlogger, 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, supportsPhaseAndSolverCachinggetCacheType, phaseEnded, phaseStarted, solvingEnded, solvingStartedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCacheTypephaseEnded, phaseStartedsolvingEnded, solvingStartedforEach, spliteratorprotected 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 PhaseLifecycleListenerstepStarted in class AbstractSelectorpublic void stepEnded(AbstractStepScope stepScope)
stepEnded in interface PhaseLifecycleListenerstepEnded in class AbstractSelectorpublic boolean isNeverEnding()
SelectorSelector.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()
IterableSelectorSelector 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 >= 0public String toString()
toString in class CompositeMoveSelectorCopyright © 2006–2018 JBoss by Red Hat. All rights reserved.