public class CartesianProductMoveSelector extends CompositeMoveSelector
CompositeMoveSelector
that Cartesian products 2 or more MoveSelector
s.
For example: a Cartesian product of {A, B, C} and {X, Y} will result in {AX, AY, BX, BY, CX, CY}.
Warning: there is no duplicated Move
check, so union of {A, B} and {B} will result in {AB, BB}.
CompositeMoveSelector
Modifier and Type | Class and Description |
---|---|
class |
CartesianProductMoveSelector.OriginalCartesianProductMoveIterator |
class |
CartesianProductMoveSelector.RandomCartesianProductMoveIterator |
childMoveSelectorList, randomSelection
logger, phaseLifecycleSupport, workingRandom
Constructor and Description |
---|
CartesianProductMoveSelector(List<MoveSelector> childMoveSelectorList,
boolean ignoreEmptyChildIterators,
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 |
isNeverEnding()
Is true if
Selector.isCountable() is false
or if this selector is in random order (for most cases). |
Iterator<Move> |
iterator() |
String |
toString() |
getChildMoveSelectorList, isCountable, supportsPhaseAndSolverCaching
getCacheType, phaseEnded, phaseStarted, solvingEnded, solvingStarted, stepEnded, stepStarted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCacheType
phaseEnded, phaseStarted, stepEnded, stepStarted
solvingEnded, solvingStarted
forEach, spliterator
public CartesianProductMoveSelector(List<MoveSelector> childMoveSelectorList, boolean ignoreEmptyChildIterators, boolean randomSelection)
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.