|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cpsolver.ifs.extension.Extension<V,T>
public class Extension<V extends Variable<V,T>,T extends Value<V,T>>
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<V,T> solver,
DataProperties properties)
Constructor |
|
| Method Summary | |
|---|---|
void |
afterAssigned(long iteration,
T value)
Called after a value is assigned to a variable |
void |
afterUnassigned(long iteration,
T value)
Called after a value is unassigned from a variable |
void |
beforeAssigned(long iteration,
T value)
Called before a value is assigned to a variable |
void |
beforeUnassigned(long iteration,
T value)
Called after a value is unassigned from a variable |
void |
constraintAdded(Constraint<V,T> constraint)
Called when a constraint is added to the model |
void |
constraintRemoved(Constraint<V,T> constraint)
Called when a constraint is removed from the model |
Model<V,T> |
getModel()
Returns the model |
DataProperties |
getProperties()
Returns input configuration |
Solver<V,T> |
getSolver()
Returns the solver |
boolean |
init(Solver<V,T> 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<V,T> model)
Registration of a model. |
void |
unregister(Model<V,T> 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(V variable)
Called when a variable is added to the model |
void |
variableRemoved(V 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<V,T> solver,
DataProperties properties)
solver - IFS solverproperties - input configuration| Method Detail |
|---|
public void register(Model<V,T> model)
public void unregister(Model<V,T> model)
public boolean isRegistered()
public Model<V,T> getModel()
public Solver<V,T> getSolver()
public DataProperties getProperties()
public void afterAssigned(long iteration,
T value)
afterAssigned in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>iteration - current iterationvalue - value to be assigned
public void afterUnassigned(long iteration,
T value)
afterUnassigned in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>iteration - current iterationvalue - value to be unassigned
public void beforeAssigned(long iteration,
T value)
beforeAssigned in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>iteration - current iterationvalue - value to be assigned
public void beforeUnassigned(long iteration,
T value)
beforeUnassigned in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>iteration - current iterationvalue - value to be unassignedpublic void constraintAdded(Constraint<V,T> constraint)
constraintAdded in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>constraint - added constraintpublic void constraintRemoved(Constraint<V,T> constraint)
constraintRemoved in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>constraint - removed constraintpublic void variableAdded(V variable)
variableAdded in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>variable - added variablepublic void variableRemoved(V variable)
variableRemoved in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>variable - removed variablepublic boolean init(Solver<V,T> solver)
init in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>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 | |||||||||