public class SimpleSelect<T extends Var> extends Object implements SelectChoicePoint<T>
| Modifier and Type | Field and Description |
|---|---|
boolean |
inputOrderTieBreaking
It chooses if input order tie breaking is used.
|
Map<T,Integer> |
position
It stores the original positions of variables to be used for input order
tie-breaking.
|
T[] |
searchVariables |
ComparatorVariable<T> |
tieBreakingComparator |
ComparatorVariable<T> |
variableOrdering |
| Constructor and Description |
|---|
SimpleSelect(T[] variables,
ComparatorVariable<T> varSelect,
ComparatorVariable<T> tieBreakerVarSelect,
Indomain<T> indomain)
It constructs a simple selection mechanism for choice points.
|
SimpleSelect(T[] variables,
ComparatorVariable<T> varSelect,
Indomain<T> indomain)
The constructor to create a simple choice select mechanism.
|
| Modifier and Type | Method and Description |
|---|---|
PrimitiveConstraint |
getChoiceConstraint(int index)
It always returns null as choice point is obtained by getChoiceVariable
and getChoiceValue.
|
int |
getChoiceValue()
It returns a value which is the base of the next choice point.
|
T |
getChoiceVariable(int index)
It returns the variable which is the base on the next choice point.
|
int |
getIndex()
It returns the current index.
|
Map<T,Integer> |
getVariablesMapping()
It returns the variables for which assignment in the solution is given.
|
T |
placeSearchVariable(int searchPosition,
int variablePosition)
It gets as input the index of the variable which is chosen by search to
be instantiated at this stage.
|
String |
toString() |
public boolean inputOrderTieBreaking
public ComparatorVariable<T extends Var> variableOrdering
public ComparatorVariable<T extends Var> tieBreakingComparator
public SimpleSelect(T[] variables, ComparatorVariable<T> varSelect, Indomain<T> indomain)
variables - variables upon which the choice points are created.varSelect - the variable comparator to choose the variable.indomain - the value heuristic to choose a value for a given variable.public SimpleSelect(T[] variables, ComparatorVariable<T> varSelect, ComparatorVariable<T> tieBreakerVarSelect, Indomain<T> indomain)
variables - variables used as basis of the choice point.varSelect - the main variable comparator.tieBreakerVarSelect - secondary variable comparator employed if the first one gives the same metric.indomain - the heuristic to choose value assigned to a chosen variable.public T getChoiceVariable(int index)
getChoiceVariable in interface SelectChoicePoint<T extends Var>index - the position of the last variable in selection choice point heuristic.public int getChoiceValue()
getChoiceValue in interface SelectChoicePoint<T extends Var>public PrimitiveConstraint getChoiceConstraint(int index)
getChoiceConstraint in interface SelectChoicePoint<T extends Var>index - the position of the last variable returned by selection choice point heuristic.public Map<T,Integer> getVariablesMapping()
getVariablesMapping in interface SelectChoicePoint<T extends Var>public int getIndex()
getIndex in interface SelectChoicePoint<T extends Var>public T placeSearchVariable(int searchPosition, int variablePosition)
searchPosition - position at which search store currently choosen variable.variablePosition - current position of the variable choosen by search.Copyright © 2022. All rights reserved.