|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.constraints.Formula
public class Formula
a class that is used to represent a syntatic formula involving unknowns. It is not a propagator (formulas have no behaviors, no semantic) By defaut, an AbstractModeler creates formulas instead of constraints
Field Summary | |
---|---|
static int |
ALL_DIFFERENT
|
int |
constraintOperator
this slots characterizes the type of formula being stored (the predicate/relation/operator) |
static int |
EQUAL_XC
possible static values for the constraintOperator field |
static int |
EQUAL_XYC
|
static int |
GLOBAL_CARDINALITY
|
static int |
GREATER_OR_EQUAL_XC
|
static int |
GREATER_OR_EQUAL_XYC
|
static int |
INT_LIN_COMB
|
static int |
LESS_OR_EQUAL_XC
|
static int |
NOT_EQUAL_XC
|
static int |
NOT_EQUAL_XYC
|
static int |
NTH
|
static int |
OCCURRENCE
|
Object[] |
parameters
storing the parameters of the constraint |
static int |
TIMES_XYZ
|
Var[] |
variables
storing the variables (IntVar, SetVar, ...) involved in the constraint |
Fields inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
LOGGER |
Constructor Summary | |
---|---|
Formula(Var[] vars,
int[] coeffs,
int c1,
int c2,
int cop)
|
|
Formula(Var[] vars,
int[] coeffs,
int c1,
int c2,
int c3,
int cop)
|
|
Formula(Var v0,
int c,
int cop)
|
|
Formula(Var v0,
Var v1,
int c,
int cop)
|
|
Formula(Var v0,
Var v1,
Var v2,
int cop)
|
Method Summary | |
---|---|
void |
addExtension(int extensionNumber)
Adds a new extension. |
Object |
clone()
|
int |
getConstraintIdx(int idx)
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c. |
int |
getConstraintOperator()
|
SConstraintType |
getConstraintType()
Return the type of constraint, ie the type of variable involved in the constraint |
Extension |
getExtension(int extensionNumber)
Returns the queried extension |
int |
getFineDegree(int idx)
Some global constraint might be able to provide some fine grained information about the "real" degree of a variables. |
int |
getNbVars()
Network management: Get the number of variables involved in the constraint. |
Var |
getVar(int i)
Network management: Accessing the ith variable of a constraint. |
Var |
getVarQuick(int i)
Network management: Accessing the ith variable of a constraint. |
boolean |
isSatisfied()
Semantic: Testing if the constraint is satisfied. |
AbstractSConstraint |
opposite(Solver solver)
computes the constraint modelling the counter-opposite condition of this |
String |
pretty()
pretty printing of the object. |
void |
setConstraintIndex(int i,
int idx)
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx. |
void |
setVar(int i,
Var v)
Network management: Setting (or overwriting) the ith variable of a constraint. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EQUAL_XC
public static final int NOT_EQUAL_XC
public static final int GREATER_OR_EQUAL_XC
public static final int LESS_OR_EQUAL_XC
public static final int EQUAL_XYC
public static final int NOT_EQUAL_XYC
public static final int GREATER_OR_EQUAL_XYC
public static final int TIMES_XYZ
public static final int INT_LIN_COMB
public static final int OCCURRENCE
public static final int ALL_DIFFERENT
public static final int GLOBAL_CARDINALITY
public static final int NTH
public int constraintOperator
public Var[] variables
public Object[] parameters
Constructor Detail |
---|
public Formula(Var v0, int c, int cop)
public Formula(Var v0, Var v1, int c, int cop)
public Formula(Var v0, Var v1, Var v2, int cop)
public Formula(Var[] vars, int[] coeffs, int c1, int c2, int cop)
public Formula(Var[] vars, int[] coeffs, int c1, int c2, int c3, int cop)
Method Detail |
---|
public int getNbVars()
SConstraint
getNbVars
in interface SConstraint
public Var getVar(int i)
SConstraint
getVar
in interface SConstraint
i
- index of the variable in the constraint
public Var getVarQuick(int i)
SConstraint
getVarQuick
in interface SConstraint
i
- index of the variable in the constraint
public void setVar(int i, Var v)
SConstraint
setVar
in interface SConstraint
i
- index of the variable in the constraintv
- the variable (may be an IntDomainVar, SetVar, RealVar, ...public boolean isSatisfied()
SConstraint
isSatisfied
in interface SConstraint
public AbstractSConstraint opposite(Solver solver)
SConstraint
opposite
in interface SConstraint
solver
- the current solver
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public int getConstraintOperator()
public void setConstraintIndex(int i, int idx)
SConstraint
setConstraintIndex
in interface SConstraint
i
- index of the variable in the constraintidx
- index of the constraint in the among all listeners linked to that variablepublic int getConstraintIdx(int idx)
SConstraint
getConstraintIdx
in interface SConstraint
idx
- index of the variable in the constraint
public String pretty()
IPretty
pretty
in interface IPretty
public SConstraintType getConstraintType()
getConstraintType
in interface SConstraint
public Extension getExtension(int extensionNumber)
IExtensionnable
getExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumber
public void addExtension(int extensionNumber)
addExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumberpublic int getFineDegree(int idx)
SConstraint
getFineDegree
in interface SConstraint
idx
- index of the variable in the constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |