|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.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 | |
|---|---|
int |
constraintOperator
this slots characterizes the type of formula being stored (the predicate/relation/operator) |
java.lang.Object[] |
parameters
storing the parameters of the constraint |
Var[] |
variables
storing the variables (IntVar, SetVar, ...) involved in the constraint |
| Constructor Summary | |
|---|---|
Formula(Var v0,
int c,
int cop)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
returns a copy of the constraint. |
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()
|
int |
getNbVars()
Network management: Get the number of variables involved in the constraint. |
AbstractProblem |
getProblem()
Retrieves the problem of the entity. |
Var |
getVar(int i)
Network management: Accessing the ith variable of a constraint. |
int |
getVarIdxInOpposite(int i)
computes the index of the i-th variable in the counter-opposite of the constraint |
boolean |
isEquivalentTo(Constraint compareTo)
tests the equivalence (logical equality of the conditions) between two constraints. |
boolean |
isSatisfied()
Semantic: Testing if the constraint is satisfied. |
AbstractConstraint |
opposite()
computes the constraint modelling the counter-opposite condition of this |
java.lang.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 int constraintOperator
public Var[] variables
public java.lang.Object[] parameters
| Constructor Detail |
|---|
public Formula(Var v0,
int c,
int cop)
| Method Detail |
|---|
public int getNbVars()
Constraint
getNbVars in interface Constraintpublic Var getVar(int i)
Constraint
getVar in interface Constrainti - index of the variable in the constraint
public void setVar(int i,
Var v)
Constraint
setVar in interface Constrainti - index of the variable in the constraintv - the variable (may be an IntDomainVar, SetVar, RealVar, ...public boolean isSatisfied()
Constraint
isSatisfied in interface Constraintpublic AbstractConstraint opposite()
Constraint
opposite in interface Constraint
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Constraint
clone in interface Constraintclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic int getConstraintOperator()
public boolean isEquivalentTo(Constraint compareTo)
Constraint
isEquivalentTo in interface ConstraintcompareTo - the constraint to be compared to
public int getVarIdxInOpposite(int i)
Constraint
getVarIdxInOpposite in interface Constrainti - the index of the variable in the current constraint (this)
public void setConstraintIndex(int i,
int idx)
Constraint
setConstraintIndex in interface Constrainti - index of the variable in the constraintidx - index of the constraint in the among all listeners linked to that variablepublic int getConstraintIdx(int idx)
Constraint
getConstraintIdx in interface Constraintidx - index of the variable in the constraintpublic AbstractProblem getProblem()
Entity
getProblem in interface Entitypublic java.lang.String pretty()
Entity
pretty in interface Entity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||