org.optaplanner.core.impl.heuristic.selector.entity.decorator
public class FilteringEntitySelector extends AbstractEntitySelector
Modifier and Type | Field and Description |
---|---|
protected boolean |
bailOutEnabled |
protected EntitySelector |
childEntitySelector |
protected List<SelectionFilter> |
filterList |
protected ScoreDirector |
scoreDirector |
logger, solverPhaseLifecycleSupport, workingRandom
Constructor and Description |
---|
FilteringEntitySelector(EntitySelector childEntitySelector,
List<SelectionFilter> filterList) |
Modifier and Type | Method and Description |
---|---|
protected long |
determineBailOutSize() |
Iterator<Object> |
endingIterator()
If
Selector.isNeverEnding() is true, then Iterable.iterator() will never end. |
PlanningEntityDescriptor |
getEntityDescriptor() |
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<Object> |
iterator() |
ListIterator<Object> |
listIterator()
|
ListIterator<Object> |
listIterator(int index)
|
void |
phaseEnded(AbstractSolverPhaseScope phaseScope) |
void |
phaseStarted(AbstractSolverPhaseScope phaseScope) |
String |
toString() |
getCacheType, solvingEnded, solvingStarted, stepEnded, stepStarted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCacheType
stepEnded, stepStarted
solvingEnded, solvingStarted
protected final EntitySelector childEntitySelector
protected final List<SelectionFilter> filterList
protected final boolean bailOutEnabled
protected ScoreDirector scoreDirector
public FilteringEntitySelector(EntitySelector childEntitySelector, List<SelectionFilter> filterList)
public void phaseStarted(AbstractSolverPhaseScope phaseScope)
phaseStarted
in interface SolverPhaseLifecycleListener
phaseStarted
in class AbstractSelector
public void phaseEnded(AbstractSolverPhaseScope phaseScope)
phaseEnded
in interface SolverPhaseLifecycleListener
phaseEnded
in class AbstractSelector
public PlanningEntityDescriptor getEntityDescriptor()
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 >= 0protected long determineBailOutSize()
public ListIterator<Object> listIterator()
ListIterable
List.listIterator()
.public ListIterator<Object> listIterator(int index)
ListIterable
index
- lower than the size of this ListIterable
, see List.listIterator(int)
.List.listIterator(int)
.public Iterator<Object> endingIterator()
EntitySelector
Selector.isNeverEnding()
is true, then Iterable.iterator()
will never end.
This returns an ending Iterator
, that tries to match Iterable.iterator()
as much as possible,
but might not respect the configuration of this EntitySelector
entirely.Iterable.iterator()
Copyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.