Package org.jacop.search
Interface SelectChoicePoint<T extends Var>
- Type Parameters:
T
- type of the variable for which choice point is being created.
- All Known Implementing Classes:
InputOrderSelect
,RandomSelect
,SimpleMatrixSelect
,SimpleSelect
,SplitRandomSelect
,SplitRandomSelectFloat
,SplitSelect
,SplitSelectFloat
,TraceGenerator
public interface SelectChoicePoint<T extends Var>
Defines an interface for defining different methods for selecting next search
decision to be taken. The search decision called choice point will be first
enforced and later upon backtrack a negation of that search decision will be
enforced.
- Version:
- 4.8
-
Method Summary
Modifier and TypeMethodDescriptiongetChoiceConstraint
(int index) It returns the constraint which is the base of the choice point.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 specifies the position of variables as given when variables of this select object were supplied.
-
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.- 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
int getChoiceValue()It returns a value which is the base of the next choice point. Only if choice is of an getChoiceVariable() = getChoiceValue() type.- Returns:
- value used in the choice point (value).
-
getChoiceConstraint
It returns the constraint which is the base of the choice point. If the return value is equal to null and choice point is also not based on X = C type of constraint then all variables have been assigned a value.- 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 specifies the position of variables as given when variables of this select object were supplied.- Returns:
- mapping of variables to the positions in the variables array.
-
getIndex
int getIndex()It returns the current index. Supplying this value in the next invocation of select will make search for next variable faster without compromising efficiency.- Returns:
- internal position of the last variable chosen to be the base of the choice point.
-