public class RandomSelect<T extends Var> extends Object implements SelectChoicePoint<T>
| Modifier and Type | Field and Description |
|---|---|
IdentityHashMap<T,Integer> |
position
It stores the original positions of variables to be used for input order
tie-breaking.
|
T[] |
searchVariables |
| Constructor and Description |
|---|
RandomSelect(T[] variables,
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.
|
IdentityHashMap<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 IdentityHashMap<T extends Var,Integer> position
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 IdentityHashMap<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 © 2016. All rights reserved.