Interface IView
-
- All Superinterfaces:
Comparable<Variable>
,ICause
,Identity
,Variable
- All Known Implementing Classes:
BoolNotView
,EqView
,IntBoolView
,IntView
,LeqView
,MinusView
,OffsetView
,RealView
,ScaleView
public interface IView extends ICause, Variable
An interface to define views. A view is a specific variable that does not declare any domain but relies on another variable. It converts getters and setters to ensure that the semantic of the view is respected. This is intend to replace very specific propagator such as equality.- Since:
- 26/08/11
- Author:
- Charles Prud'homme
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
explain(ExplanationForSignedClause explanation, ValueSortedMap<IntVar> front, Implications ig, int p)
Clausal explanation for this cause.IntVar
getVariable()
Return the basis variablevoid
justifyEvent(IntEventType mask, int one, int two, int three)
This methods is related to explanations, it binds an event occurring on the observed variable to the view.void
notify(IEventType event)
To notify a view that the variable is observed has been modified.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.chocosolver.solver.ICause
forEachIntVar
-
Methods inherited from interface org.chocosolver.solver.variables.Variable
addMonitor, asBoolVar, asIntVar, asRealVar, asSetVar, clearEvents, contradiction, createDelta, getCause, getDelta, getDindex, getEnvironment, getEvtScheduler, getIndexInPropagator, getMask, getModel, getName, getNbProps, getNbViews, getPIndices, getPropagator, getPropagators, getTypeAndKind, getView, isAConstant, isInstantiated, link, notifyMonitors, notifyPropagators, notifyViews, removeMonitor, setPIndice, storeEvents, subscribeView, swapOnActivate, swapOnPassivate, unlink
-
-
-
-
Method Detail
-
getVariable
IntVar getVariable()
Return the basis variable- Returns:
- variable observed
-
justifyEvent
void justifyEvent(IntEventType mask, int one, int two, int three)
This methods is related to explanations, it binds an event occurring on the observed variable to the view.- Parameters:
mask
- type of modificationone
- an inttwo
- an intthree
- an int
-
notify
void notify(IEventType event) throws ContradictionException
To notify a view that the variable is observed has been modified.- Parameters:
event
- the event received by the observed variable- Throws:
ContradictionException
- if a failure occurs
-
explain
default void explain(ExplanationForSignedClause explanation, ValueSortedMap<IntVar> front, Implications ig, int p)
Description copied from interface:ICause
Clausal explanation for this cause.This method must filled explanations with inferred literals. These literals are inferred from the analysis of (a subset of) conflicting nodes stored in front, the implication graph ig and the current node in conflict, not yet contained in front.
Optionally, this method can update front by looking for a predecessor of any node that seems more relevant than the declared one.
-
-