choco.palm.search
Class Assignment

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.palm.search.AbstractDecision
          extended by choco.palm.search.Assignment
All Implemented Interfaces:
Constraint, Entity, DecisionConstraint, PalmConstraint, PalmVarListener, SymbolicDecision, VarEventListener, Propagator, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener

public class Assignment
extends AbstractDecision
implements java.lang.Comparable

Created by IntelliJ IDEA. User: Hadrien Date: 29 déc. 2004 Time: 16:41:51 To change this template use File | Settings | File Templates.


Field Summary
protected  int value
           
protected  ExplainedIntVar var
           
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
Assignment(ExplainedIntVar var, int value)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 void constAwake(boolean b)
          Forces a propagation of the constraint.
 void delete()
          Removes a constraint from the network.
 boolean equals(Assignment dec)
           
 int getBranch()
          Returns the number identifying the current branch.
 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.
 boolean isCompletelyInstantiated()
          Utility: Testing if all variables involved in the constraint are instantiated.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 java.lang.String pretty()
          pretty printing of the object.
 void setVar(int i, Var v)
          Network management: Setting (or overwriting) the ith variable of a constraint.
 
Methods inherited from class choco.palm.search.AbstractDecision
activateListener, addListener, assignIndices, awake, awakeOnVar, clone, deactivateListener, deactivateListener, getConstraintIdx, getEvent, getPlugIn, getPriority, getVarIdxInOpposite, isActive, isConsistent, isEntailed, isEquivalentTo, negate, opposite, propagate, setActive, setConstraintIndex, setPassive, takeIntoAccountStatusChange, updateDataStructuresOnConstraint, updateDataStructuresOnRestoreConstraint
 
Methods inherited from class choco.AbstractEntity
getProblem
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

var

protected ExplainedIntVar var

value

protected int value
Constructor Detail

Assignment

public Assignment(ExplainedIntVar var,
                  int value)
Method Detail

getBranch

public int getBranch()
Description copied from interface: DecisionConstraint
Returns the number identifying the current branch.

Specified by:
getBranch in interface DecisionConstraint
Specified by:
getBranch in interface SymbolicDecision

getNbVars

public int getNbVars()
Description copied from interface: Constraint
Network management: Get the number of variables involved in the constraint.

Specified by:
getNbVars in interface Constraint

getVar

public Var getVar(int i)
Description copied from interface: Constraint
Network management: Accessing the ith variable of a constraint.

Specified by:
getVar in interface Constraint
Parameters:
i - index of the variable in the constraint

setVar

public void setVar(int i,
                   Var v)
Description copied from interface: Constraint
Network management: Setting (or overwriting) the ith variable of a constraint.

Specified by:
setVar in interface Constraint
Parameters:
i - index of the variable in the constraint
v - the variable (may be an IntDomainVar, SetVar, RealVar, ...

isCompletelyInstantiated

public boolean isCompletelyInstantiated()
Description copied from interface: Propagator
Utility: Testing if all variables involved in the constraint are instantiated.

Specified by:
isCompletelyInstantiated in interface Propagator

isSatisfied

public boolean isSatisfied()
Description copied from interface: Constraint
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.

Specified by:
isSatisfied in interface Constraint

pretty

public java.lang.String pretty()
Description copied from interface: Entity
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface Entity
Overrides:
pretty in class AbstractEntity
Returns:
a readable string representation of the object

equals

public boolean equals(Assignment dec)

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

delete

public void delete()
Description copied from interface: Propagator
Removes a constraint from the network. Beware, this is a permanent removal, it may not be backtracked

Specified by:
delete in interface Propagator

constAwake

public void constAwake(boolean b)
Description copied from interface: Propagator
Forces a propagation of the constraint.

Specified by:
constAwake in interface Propagator