|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<V>
public abstract class AbstractSConstraint<V extends Var>
An abstract class for all implementations of listeners
Field Summary | |
---|---|
int[] |
cIndices
The list, containing, for each variable, the index of the constraint among all its incident listeners. |
protected SConstraintType |
constraintType
Return the type of constraint. |
Extension[] |
extensions
The extensions of this constraint, in order to add some data linked to this constraint (for specific algorithms) |
protected V[] |
vars
The list of variables of the constraint. |
Fields inherited from class choco.kernel.solver.propagation.Propagator |
---|
active, constAwakeEvent, priority, propagationEngine |
Fields inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
LOGGER |
Constructor Summary | |
---|---|
protected |
AbstractSConstraint(int priority,
V[] vars)
Constructs a constraint with the specified priority. |
protected |
AbstractSConstraint(V[] vars)
Constructs a constraint with the priority 0. |
Method Summary | |
---|---|
void |
addExtension(int extensionNumber)
Adds a new extension. |
void |
addListener(boolean dynamicAddition)
This function connects a constraint with its variables in several ways. |
Object |
clone()
Clone the constraint |
static int |
getAbstractSConstraintExtensionNumber(String name)
Returns a new number of extension registration |
int |
getConstraintIdx(int i)
Returns the index of the constraint in the specified variable. |
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 |
getNbVarNotInst()
CPRU 07/12/2007: DomOverWDeg implementation This method returns the number of variables not already instanciated |
int |
getNbVars()
Returns the number of variables. |
V |
getVar(int i)
Returns the i th variable. |
V |
getVarQuick(int i)
Network management: Accessing the ith variable of a constraint. |
boolean |
isCompletelyInstantiated()
Checks wether all the variables are instantiated. |
Boolean |
isEntailed()
Indicates if the constraint is entailed, from now on will be always satisfied |
AbstractSConstraint<V> |
opposite(Solver solver)
Get the opposite constraint |
String |
pretty()
pretty printing of the object. |
void |
setConstraintIndex(int i,
int val)
Let v be the i-th var of c, records that c is the n-th constraint involving v. |
void |
setExtension(Extension ext,
int extensionNumber)
|
void |
setVar(int i,
V v)
Network management: Setting (or overwriting) the ith variable of a constraint. |
String |
toString()
|
Methods inherited from class choco.kernel.solver.propagation.Propagator |
---|
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, getPriority, isActive, isConsistent, propagate, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
getConstraintType, isSatisfied |
Field Detail |
---|
protected V extends Var[] vars
public int[] cIndices
protected SConstraintType constraintType
public Extension[] extensions
Constructor Detail |
---|
protected AbstractSConstraint(V[] vars)
vars
- variables involved in the constraintprotected AbstractSConstraint(int priority, V[] vars)
priority
- The wished priority.vars
- variables involved in the constraintMethod Detail |
---|
public static int getAbstractSConstraintExtensionNumber(String name)
name
- A name for the extension (should be an UID, like the anbsolute path for instance)
public void addExtension(int extensionNumber)
addExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumberpublic final Extension getExtension(int extensionNumber)
getExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumber
public final void setExtension(Extension ext, int extensionNumber)
public Boolean isEntailed()
isEntailed
in class Propagator
public void addListener(boolean dynamicAddition)
addListener
in class Propagator
dynamicAddition
- if the addition should be dynamicalpublic final void setConstraintIndex(int i, int val)
setConstraintIndex
in interface SConstraint<V extends Var>
i
- index of the variable in the constraintval
- index of the constraint in the among all listeners linked to that variablepublic final int getConstraintIdx(int i)
getConstraintIdx
in interface SConstraint<V extends Var>
i
- index of the variable in the constraint
public final boolean isCompletelyInstantiated()
isCompletelyInstantiated
in class Propagator
public final int getNbVars()
getNbVars
in interface SConstraint<V extends Var>
public final V getVar(int i)
i
th variable.
getVar
in interface SConstraint<V extends Var>
i
- index of the variable in the constraint
public final V getVarQuick(int i)
SConstraint
getVarQuick
in interface SConstraint<V extends Var>
i
- index of the variable in the constraint
public final void setVar(int i, V v)
SConstraint
setVar
in interface SConstraint<V extends Var>
i
- index of the variable in the constraintv
- the variable (may be an IntDomainVar, SetVar, RealVar, ...public AbstractSConstraint<V> opposite(Solver solver)
opposite
in interface SConstraint<V extends Var>
solver
- the current solver
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- Clone not supported exceptionpublic final int getNbVarNotInst()
public String toString()
toString
in class Object
public String pretty()
IPretty
pretty
in interface IPretty
public int getFineDegree(int idx)
getFineDegree
in interface SConstraint<V extends Var>
idx
- index of the variable in the constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |