|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.search.SimpleMatrixSelect<T>
T - type of variable being used in the Search.public class SimpleMatrixSelect<T extends Var>
SimpleMatrixSelect selects first a row in the matrix based on metric of the variable at pivotPosition. As soon as a row is choosen, variables starting from the beginning of the row which are not assigned yet are selected. The row selection is done with the help of variable comparators. Two comparators can be employed main and tiebreaking one. If two are not sufficient to differentiate two rows than the lexigraphical ordering is used. Default values: pivotPosition = 0, mainComparator = InputOrder, tieBreakingComparator = InputOrder.
| Field Summary | |
|---|---|
boolean |
inputOrderTieBreaking
It decides if input order tiebreaking is used. |
int |
pivotPosition
It specifies the pivot position (first element has index 0). |
java.util.IdentityHashMap<T,java.lang.Integer> |
position
It stores the original positions of variables to be used for input order tie-breaking. |
java.util.ArrayList<java.util.ArrayList<T>> |
searchVariables
It stores variables which need to be labelled. |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
java.util.IdentityHashMap<T,java.lang.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. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean inputOrderTieBreaking
public int pivotPosition
public java.util.IdentityHashMap<T extends Var,java.lang.Integer> position
public java.util.ArrayList<java.util.ArrayList<T extends Var>> searchVariables
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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 java.util.IdentityHashMap<T,java.lang.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()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||