|
CIDER Toolkit Version 0.1.0-beta |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--ConstraintSolver
This abstract base class allows a multi-way constraint solver to be implemented in the CIDER toolkit. Classes that extend this base class should also define a no-argument constructor.
| Constructor Summary | |
ConstraintSolver()
|
|
| Method Summary | |
abstract boolean |
addConstraint(Constraint c)
Adds a constraint to the solver. |
void |
addConstraintVariableListener(ConstraintVariableListener cvl)
Adds an listener to listen for solver events (which are launched whenever a constraint variable is modified by the solver). |
abstract void |
addEditVariable(ConstraintVariable v)
Informs the solver that a new desired value is going to be suggested for a particular variable. |
abstract void |
addVariable(ConstraintVariable v)
Adds a constraint variable to the solver. |
abstract java.util.Set |
getConstraints()
Returns a set containing all constraints in the solver. |
abstract java.util.Set |
getConstraintVariables()
Returns a set containing all constraint variables in the solver (including, of course, all variables used by constraints in the solver). |
void |
launchVariableModifiedEvent(ConstraintVariable cv,
java.lang.Double oldValue)
Launches an event which indicates that a constraint variable has been modified. |
abstract boolean |
removeConstraint(Constraint c)
Removes a constraint from the solver if possible. |
void |
removeConstraintVariableListener(ConstraintVariableListener cvl)
Removes a listener that listens for solver events (which are launched whenever a constraint variable is modified by the solver). |
abstract boolean |
removeVariable(ConstraintVariable v)
Removes a constraint variable from the solver if possible. |
abstract void |
resolve()
Calls the solver to re-solve the constraints. |
abstract void |
solve()
Calls the solver to solve all constraints. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConstraintSolver()
| Method Detail |
public abstract void addVariable(ConstraintVariable v)
v - The variable to be added.public abstract boolean removeVariable(ConstraintVariable v)
v - The variable to be removed.
true if the variable successfully removed, false otherwise.public abstract boolean addConstraint(Constraint c)
c - The constraint to be added.
true if successful, false if the constraint could not be added
because it conflicts with the existing constraints in the solver.public abstract boolean removeConstraint(Constraint c)
c - The constraint to be removed.
true if the constraint successfully removed, false otherwise.public abstract void addEditVariable(ConstraintVariable v)
v - The variable to be edited.public abstract java.util.Set getConstraints()
public abstract java.util.Set getConstraintVariables()
public abstract void solve()
This method must call the launchVariableModifiedEvent(au.edu.monash.csse.tonyj.cider.constraints.ConstraintVariable, java.lang.Double) method for
each constraint variable whose value has been modified by this call.
public abstract void resolve()
This method must call the launchVariableModifiedEvent(au.edu.monash.csse.tonyj.cider.constraints.ConstraintVariable, java.lang.Double) method for
each constraint variable whose value has been modified by this call.
public void addConstraintVariableListener(ConstraintVariableListener cvl)
cvl - The listener to be added.public void removeConstraintVariableListener(ConstraintVariableListener cvl)
cvl - The listener to be removed.
public void launchVariableModifiedEvent(ConstraintVariable cv,
java.lang.Double oldValue)
cv - The constraint variable that was modified.oldValue - The old solved value of the constraint variable before the modificaton.
|
CIDER Toolkit Version 0.1.0-beta |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||