V
- VariableT
- Valuepublic class MacRevised<V extends Variable<V,T>,T extends Value<V,T>> extends ExtensionWithContext<V,T,MacRevised.NoGood>
MacPropagation
Modifier and Type | Class and Description |
---|---|
class |
MacRevised.NoGood
Assignment context
|
Modifier and Type | Field and Description |
---|---|
protected List<Constraint<V,T>> |
iConstraints
List of constraints on which arc-consistency is to be maintained
|
protected long |
iIteration
Current iteration
|
sMaxSize
Constructor and Description |
---|
MacRevised(Solver<V,T> solver,
DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(Constraint<V,T> constraint)
Adds a constraint on which arc-consistency is to be maintained
|
void |
afterAssigned(Assignment<V,T> assignment,
long iteration,
T 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(Assignment<V,T> assignment,
long iteration,
T value)
After a value is unassigned: explanations of all values of unassigned
variable are recomputed (
Value.conflicts(Assignment) ), propagation undo
over the unassigned variable takes place. |
void |
beforeAssigned(Assignment<V,T> assignment,
long iteration,
T 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<V,T> constraint)
Returns true, if arc-consistency is to be maintained on the given
constraint
|
MacRevised.NoGood |
createAssignmentContext(Assignment<V,T> assignment)
Create a new assignment context for the given assignment.
|
boolean |
init(Solver<V,T> solver)
Initialization.
|
getAssignmentContextReference, getContext, getContext, setAssignmentContextReference, unregister
beforeUnassigned, constraintAdded, constraintRemoved, getModel, getProperties, getSolver, isRegistered, register, variableAdded, variableRemoved
protected List<Constraint<V extends Variable<V,T>,T extends Value<V,T>>> iConstraints
protected long iIteration
public MacRevised(Solver<V,T> solver, DataProperties properties)
solver
- current solverproperties
- solver configurationpublic void addConstraint(Constraint<V,T> constraint)
constraint
- a hard constraint to be addedpublic boolean contains(Constraint<V,T> constraint)
constraint
- a constraintpublic void beforeAssigned(Assignment<V,T> assignment, long iteration, T value)
public void afterAssigned(Assignment<V,T> assignment, long iteration, T value)
public void afterUnassigned(Assignment<V,T> assignment, long iteration, T value)
Value.conflicts(Assignment)
), propagation undo
over the unassigned variable takes place.public boolean init(Solver<V,T> solver)
public MacRevised.NoGood createAssignmentContext(Assignment<V,T> assignment)
HasAssignmentContext
assignment
- an assignment for which there needs to be an assignment context