Package org.jacop.search
Class InputOrderSelect<T extends Var>
java.lang.Object
org.jacop.search.InputOrderSelect<T>
- Type Parameters:
T
- type of variable being used in the search.
- All Implemented Interfaces:
SelectChoicePoint<T>
It is simple input order selector of variables.
- Version:
- 4.9
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final boolean
It stores the original positions of variables to be used for input order tie-breaking.(package private) T[]
-
Constructor Summary
ConstructorsConstructorDescriptionInputOrderSelect
(Store store, T[] variables, Indomain<T> indomain) It constructs an input order selection procedure. -
Method Summary
Modifier and TypeMethodDescriptiongetChoiceConstraint
(int index) It always returns null as choice point is obtained by getChoiceVariable and getChoiceValue.int
It returns a value which is the base of the next choice point.getChoiceVariable
(int index) It returns the variable which is the base on the next choice point.int
getIndex()
It returns the current index.It returns the variables for which assignment in the solution is given.toString()
-
Field Details
-
debugAll
static final boolean debugAll- See Also:
-
searchVariables
-
valueOrdering
-
currentIndex
-
position
It stores the original positions of variables to be used for input order tie-breaking.
-
-
Constructor Details
-
InputOrderSelect
It constructs an input order selection procedure.- Parameters:
store
- a constraint store in which variables resides.variables
- a list of variables which must be assigned a value by search.indomain
- the indomain heuristic for assigning values to variables.
-
-
Method Details
-
getChoiceVariable
It returns the variable which is the base on the next choice point. Only if choice is of an X = C type. This function returns null if all variables have a value assigned or a choice point based on other type of constraint is being selected. The parameter index is the last variable which have been return by this SelectChoicePoint object which has not been backtracked upon yet.- Specified by:
getChoiceVariable
in interfaceSelectChoicePoint<T extends Var>
- Parameters:
index
- the position of the last variable in selection choice point heuristic.- Returns:
- variable based on which the choice needs to be created.
-
getChoiceValue
public int getChoiceValue()It returns a value which is the base of the next choice point. Only if choice is of an X = C type.- Specified by:
getChoiceValue
in interfaceSelectChoicePoint<T extends Var>
- Returns:
- value used in the choice point (value).
-
getChoiceConstraint
It always returns null as choice point is obtained by getChoiceVariable and getChoiceValue.- Specified by:
getChoiceConstraint
in interfaceSelectChoicePoint<T extends Var>
- Parameters:
index
- the position of the last variable returned by selection choice point heuristic.- Returns:
- primitive constraint which is a base of a choice point.
-
getVariablesMapping
It returns the variables for which assignment in the solution is given.- Specified by:
getVariablesMapping
in interfaceSelectChoicePoint<T extends Var>
- Returns:
- mapping of variables to the positions in the variables array.
-
getIndex
public int getIndex()It returns the current index. Supplying this value in the next invocation of select will make search for next variable faster without comprimising efficiency.- Specified by:
getIndex
in interfaceSelectChoicePoint<T extends Var>
- Returns:
- internal position of the last variable chosen to be the base of the choice point.
-
toString
-