V - VariableT - ValueC - Assignment Contextpublic abstract class ExtensionWithContext<V extends Variable<V,T>,T extends Value<V,T>,C extends AssignmentContext> extends Extension<V,T> implements HasAssignmentContext<V,T,C>, CanHoldContext
AssignmentContext interface). This context is created by calling
HasAssignmentContext.createAssignmentContext(Assignment) and accessed by
ConstraintWithContext.getContext(Assignment).AssignmentContextsMaxSize| Constructor and Description |
|---|
ExtensionWithContext(Solver<V,T> solver,
DataProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
AssignmentContextReference<V,T,C> |
getAssignmentContextReference()
Returns an assignment context reference
|
AssignmentContext[] |
getContext()
An array of
CanHoldContext.sMaxSize assignment contexts |
C |
getContext(Assignment<V,T> assignment)
Returns an assignment context associated with this extension.
|
boolean |
init(Solver<V,T> solver)
Initialization -- called before the solver is started
|
void |
setAssignmentContextReference(AssignmentContextReference<V,T,C> reference)
Store an assignment context reference that was given for the class by the
Model.createReference(HasAssignmentContext). |
void |
unregister(Model<V,T> model)
Unregistration of a model.
|
afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, constraintAdded, constraintRemoved, getModel, getProperties, getSolver, isRegistered, register, variableAdded, variableRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAssignmentContextpublic ExtensionWithContext(Solver<V,T> solver, DataProperties properties)
public boolean init(Solver<V,T> solver)
Extensionpublic C getContext(Assignment<V,T> assignment)
HasAssignmentContext.createAssignmentContext(Assignment) method. From that time on,
this context is kept with the assignment.getContext in interface HasAssignmentContext<V extends Variable<V,T>,T extends Value<V,T>,C extends AssignmentContext>assignment - given assignmentpublic AssignmentContextReference<V,T,C> getAssignmentContextReference()
HasAssignmentContextgetAssignmentContextReference in interface HasAssignmentContext<V extends Variable<V,T>,T extends Value<V,T>,C extends AssignmentContext>Model.createReference(HasAssignmentContext) during initializationpublic void setAssignmentContextReference(AssignmentContextReference<V,T,C> reference)
HasAssignmentContextModel.createReference(HasAssignmentContext).setAssignmentContextReference in interface HasAssignmentContext<V extends Variable<V,T>,T extends Value<V,T>,C extends AssignmentContext>reference - reference provided by the model by calling Model.createReference(HasAssignmentContext) during initializationpublic AssignmentContext[] getContext()
CanHoldContextCanHoldContext.sMaxSize assignment contextsgetContext in interface CanHoldContext