|
||||||||||
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
public class Extension
Generic extension of IFS solver.
All extensions should extend this class.
An extension may use extra information associated with a variable or a value
(see Variable.setExtra(Object)
, Variable.getExtra()
, Value.setExtra(Object)
, Value.getExtra()
)
but there can be only one extension using these extra objects used during the search.
For instance, MacPropagation
is using these extra objects to memorize explanations.
Constructor Summary | |
---|---|
Extension(Solver solver,
DataProperties properties)
Constructor |
Method Summary | |
---|---|
void |
afterAssigned(long iteration,
Value value)
Called after a value is assigned to a variable |
void |
afterUnassigned(long iteration,
Value value)
Called after a value is unassigned from a variable |
void |
beforeAssigned(long iteration,
Value value)
Called before a value is assigned to a variable |
void |
beforeUnassigned(long iteration,
Value value)
Called after a value is unassigned from a variable |
void |
constraintAdded(Constraint constraint)
Called when a constraint is added to the model |
void |
constraintRemoved(Constraint constraint)
Called when a constraint is removed from the model |
Model |
getModel()
Returns the model |
DataProperties |
getProperties()
Returns input configuration |
Solver |
getSolver()
Returns the solver |
boolean |
init(Solver solver)
Initialization -- called before the solver is started |
boolean |
isRegistered()
Returns true if there is a model registered to this extension, i.e., when extension is registered. |
void |
register(Model model)
Registration of a model. |
void |
unregister(Model model)
Unregistration of a model. |
boolean |
useValueExtra()
Should return true when Value.setExtra(Object) , Value.getExtra() are used by the extension |
boolean |
useVariableExtra()
Should return true when Variable.setExtra(Object) , Variable.getExtra() are used by the extension |
void |
variableAdded(Variable variable)
Called when a variable is added to the model |
void |
variableRemoved(Variable variable)
Called when a variable is removed from the model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Extension(Solver solver, DataProperties properties)
solver
- IFS solverproperties
- input configurationMethod Detail |
---|
public void register(Model model)
public void unregister(Model model)
public boolean isRegistered()
public Model getModel()
public Solver getSolver()
public DataProperties getProperties()
public void afterAssigned(long iteration, Value value)
afterAssigned
in interface ModelListener
iteration
- current iterationvalue
- value to be assignedpublic void afterUnassigned(long iteration, Value value)
afterUnassigned
in interface ModelListener
iteration
- current iterationvalue
- value to be unassignedpublic void beforeAssigned(long iteration, Value value)
beforeAssigned
in interface ModelListener
iteration
- current iterationvalue
- value to be assignedpublic void beforeUnassigned(long iteration, Value value)
beforeUnassigned
in interface ModelListener
iteration
- current iterationvalue
- value to be unassignedpublic void constraintAdded(Constraint constraint)
constraintAdded
in interface ModelListener
constraint
- added constraintpublic void constraintRemoved(Constraint constraint)
constraintRemoved
in interface ModelListener
constraint
- removed constraintpublic void variableAdded(Variable variable)
variableAdded
in interface ModelListener
variable
- added variablepublic void variableRemoved(Variable variable)
variableRemoved
in interface ModelListener
variable
- removed variablepublic boolean init(Solver solver)
init
in interface ModelListener
solver
- IFS solverpublic boolean useValueExtra()
Value.setExtra(Object)
, Value.getExtra()
are used by the extension
public boolean useVariableExtra()
Variable.setExtra(Object)
, Variable.getExtra()
are used by the extension
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |