|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.extension.Extension net.sf.cpsolver.ifs.extension.MacRevised
public class MacRevised
Another implementation of MAC propagation.
MacPropagation
Field Summary | |
---|---|
protected Vector |
iConstraints
List of constraints on which arc-consistency is to be maintained |
protected long |
iIteration
Current iteration |
Constructor Summary | |
---|---|
MacRevised(Solver solver,
DataProperties properties)
Constructor |
Method Summary | |
---|---|
void |
addConstraint(Constraint constraint)
Adds a constraint on which arc-consistency is to be maintained |
void |
afterAssigned(long iteration,
Value value)
After a value is assigned: explanations of other values of the value's variable are reset (to contain only the assigned value), propagation over the assigned variable takes place. |
void |
afterUnassigned(long iteration,
Value value)
After a value is unassigned: explanations of all values of unassigned variable are recomputed ( Value.conflicts() ), propagation
undo over the unassigned variable takes place. |
void |
beforeAssigned(long iteration,
Value value)
Before a value is unassigned: until the value is inconsistent with the current solution, an assignment from its explanation is picked and unassigned. |
boolean |
contains(Constraint constraint)
Returns true, if arc-consistency is to be maintained on the given constraint |
HashSet |
explanation(Constraint constraint,
Value value,
Variable variable)
|
Set |
goodValues(Variable variable)
good values of a variable (values not removed from variables domain) |
boolean |
hasSupport(Constraint constraint,
Value value,
Variable variable)
|
boolean |
init(Solver solver)
Initialization. |
boolean |
isGood(Value value)
is variable good |
Set |
noGood(Value value)
variables explanation |
void |
propagate(Constraint constraint,
Value noGoodValue,
Vector queue)
|
void |
propagate(Vector queue)
|
boolean |
revise(Constraint constraint,
Value value)
|
boolean |
revise(Value value)
|
protected void |
setGood(Value value)
sets value to be good |
void |
setNoGood(Value value,
Set reason)
sets value's explanation |
HashSet |
supports(Constraint constraint,
Value value,
Variable variable)
|
Methods inherited from class net.sf.cpsolver.ifs.extension.Extension |
---|
beforeUnassigned, constraintAdded, constraintRemoved, getModel, getProperties, getSolver, isRegistered, register, unregister, useValueExtra, useVariableExtra, variableAdded, variableRemoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector iConstraints
protected long iIteration
Constructor Detail |
---|
public MacRevised(Solver solver, DataProperties properties)
Method Detail |
---|
public void addConstraint(Constraint constraint)
public boolean contains(Constraint constraint)
public void beforeAssigned(long iteration, Value value)
beforeAssigned
in interface ModelListener
beforeAssigned
in class Extension
iteration
- current iterationvalue
- value to be assignedpublic void afterAssigned(long iteration, Value value)
afterAssigned
in interface ModelListener
afterAssigned
in class Extension
iteration
- current iterationvalue
- value to be assignedpublic void afterUnassigned(long iteration, Value value)
Value.conflicts()
), propagation
undo over the unassigned variable takes place.
afterUnassigned
in interface ModelListener
afterUnassigned
in class Extension
iteration
- current iterationvalue
- value to be unassignedpublic void propagate(Vector queue)
public void propagate(Constraint constraint, Value noGoodValue, Vector queue)
public boolean revise(Value value)
public boolean revise(Constraint constraint, Value value)
public HashSet explanation(Constraint constraint, Value value, Variable variable)
public HashSet supports(Constraint constraint, Value value, Variable variable)
public boolean hasSupport(Constraint constraint, Value value, Variable variable)
public boolean init(Solver solver)
init
in interface ModelListener
init
in class Extension
solver
- IFS solverpublic Set goodValues(Variable variable)
public Set noGood(Value value)
public boolean isGood(Value value)
protected void setGood(Value value)
public void setNoGood(Value value, Set reason)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |