public abstract class AbstractConstraint extends Object implements Constraint
Constructor and Description |
---|
AbstractConstraint(Solver cp) |
Modifier and Type | Method and Description |
---|---|
Solver |
getSolver() |
boolean |
isActive()
Returns the active status of the constraint.
|
boolean |
isScheduled()
Returns the schedule status in the fix-point.
|
void |
post()
Initializes the constraint when it is posted to the solver.
|
void |
propagate()
Propagates the constraint.
|
void |
setActive(boolean active)
Activates or deactivates the constraint such that it is not scheduled any more.
|
void |
setScheduled(boolean scheduled)
Set the status of the constraint as
scheduled to be propagated by the fix-point.
|
public AbstractConstraint(Solver cp)
public void post()
Constraint
post
in interface Constraint
public Solver getSolver()
public void propagate()
Constraint
propagate
in interface Constraint
public void setScheduled(boolean scheduled)
Constraint
setScheduled
in interface Constraint
scheduled
- a value that is true when the constraint
is enqueued in the propagation queue,
false when dequeuedSolver.fixPoint()
public boolean isScheduled()
Constraint
isScheduled
in interface Constraint
Constraint.setScheduled(boolean)
given to setScheduledpublic void setActive(boolean active)
Constraint
Typically called by the Constraint to let the solver know it should not be scheduled any more when it is subsumed.
By default the constraint is active.
setActive
in interface Constraint
active
- the status to be set,
this state is reversible and unset
on state restoration StateManager.restoreState()
public boolean isActive()
Constraint
isActive
in interface Constraint
Constraint.setActive(boolean)
in this state frame StateManager.restoreState()
.Copyright © 2018 Laurent Michel, Pierre Schaus, Pascal Van Hentenryck. All rights reserved.