T
- type of variable being used in the Search.public class SimpleMatrixSelect<T extends Var> extends Object implements SelectChoicePoint<T>
Default values: pivotPosition = 0, mainComparator = InputOrder, tieBreakingComparator = InputOrder.
Modifier and Type | Field and Description |
---|---|
boolean |
inputOrderTieBreaking
It decides if input order tiebreaking is used.
|
int |
pivotPosition
It specifies the pivot position (first element has index 0).
|
Map<T,Integer> |
position
It stores the original positions of variables to be used for input order
tie-breaking.
|
List<List<T>> |
searchVariables
It stores variables which need to be labelled.
|
Constructor and Description |
---|
SimpleMatrixSelect(T[][] vars,
ComparatorVariable<T> mainComparator,
ComparatorVariable<T> tieBreakingComparator,
Indomain<T> indomain)
It constructs a MatrixSelection variable ordering.
|
SimpleMatrixSelect(T[][] vars,
ComparatorVariable<T> mainComparator,
ComparatorVariable<T> tieBreakingComparator,
Indomain<T> indomain,
int pivotPosition)
This constructor allows to specify all parameters for the selection mechanism.
|
SimpleMatrixSelect(T[][] vars,
ComparatorVariable<T> mainComparator,
Indomain<T> indomain)
It constructs a MatrixSelection variable ordering.
|
SimpleMatrixSelect(T[][] vars,
Indomain<T> indomain)
This constructor uses default values for all parameters.
|
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 firstVariable)
It returns the variable which is the base on the next choice point.
|
int |
getIndex()
It returns the current index.
|
int |
getPivotPosition()
It returns the position of the pivot variable.
|
Map<T,Integer> |
getVariablesMapping()
It returns the variables for which assignment in the solution is given.
|
void |
setDynamicLexTieBreaking()
It uses cheap method of breaking the ties.
|
void |
setInputOrderTieBreaking()
It chooses input order tiebreaking if the supplied comparators
can not distinguish between matrix rows.
|
String |
toString() |
public boolean inputOrderTieBreaking
public int pivotPosition
public Map<T extends Var,Integer> position
public SimpleMatrixSelect(T[][] vars, Indomain<T> indomain)
vars
- variables to choose from.indomain
- value ordering heuristic used to choose a value for a given variable.public SimpleMatrixSelect(T[][] vars, ComparatorVariable<T> mainComparator, Indomain<T> indomain)
vars
- matrix of variables to be selected from.mainComparator
- the variable comparator to choose the proper vector.indomain
- variable ordering value to be used to determine value for a given variable.public SimpleMatrixSelect(T[][] vars, ComparatorVariable<T> mainComparator, ComparatorVariable<T> tieBreakingComparator, Indomain<T> indomain)
vars
- matrix of variables to be selected from.mainComparator
- the variable comparator to choose the proper vector.tieBreakingComparator
- the variable comparator used if the main comparator can not distinguish between vectors.indomain
- variable ordering value to be used to determine value for a given variable.public SimpleMatrixSelect(T[][] vars, ComparatorVariable<T> mainComparator, ComparatorVariable<T> tieBreakingComparator, Indomain<T> indomain, int pivotPosition)
vars
- variables from which the base of the choice point is choosen.mainComparator
- the main variable comparator used to compare variables.tieBreakingComparator
- the secondary variable comparator used to break ties.indomain
- the value ordering heuristic used to assign value to a chosen variable.pivotPosition
- the position of the variable which is used to rank the rows.public T getChoiceVariable(int firstVariable)
getChoiceVariable
in interface SelectChoicePoint<T extends Var>
firstVariable
- 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 int getPivotPosition()
public void setDynamicLexTieBreaking()
public void setInputOrderTieBreaking()
Copyright © 2022. All rights reserved.