Package org.jacop.constraints.netflow
Class DomainStructure
java.lang.Object
org.jacop.constraints.netflow.DomainStructure
- All Implemented Interfaces:
VarHandler
A domain based structure variable.
Arcs can be associated to sub-domains of the structure variable. The state of the arc is said to be active if the variable takes a value from its sub-domain and it is inactive otherwise.
- Version:
- 4.10
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Arc[]final DomainStructure.Behaviorfinal IntDomain[]intfinal IntVar -
Constructor Summary
ConstructorsConstructorDescriptionCreates an S-variableDomainStructure(IntVar variable, IntDomain[] domains, Arc[] arcs) DomainStructure(IntVar variable, IntDomain[] domains, Arc[] arcs, DomainStructure.Behavior behavior) -
Method Summary
Modifier and TypeMethodDescriptionintgetPruningEvent(Var var) Retrieves the consistency pruning event of a handler variable that causes the handler to be reevaluated.private voidgroundArc(int arcID, boolean active, MutableNetwork network) booleanisGrounded(int arcID) voidprocessEvent(IntVar variable, MutableNetwork network) Informs the handler that one of its variable has changed and asks the handler to update the state of the network accordingly.private voidswap(int i, int j) voidungroundArc(int arcID)
-
Field Details
-
variable
-
arcs
-
domains
-
behavior
-
notGrounded
public int notGrounded
-
-
Constructor Details
-
DomainStructure
Creates an S-variable- Parameters:
variable- variable to create fordomList- list of domainsarcList- list of arcs
-
DomainStructure
-
DomainStructure
public DomainStructure(IntVar variable, IntDomain[] domains, Arc[] arcs, DomainStructure.Behavior behavior)
-
-
Method Details
-
processEvent
Description copied from interface:VarHandlerInforms the handler that one of its variable has changed and asks the handler to update the state of the network accordingly.- Specified by:
processEventin interfaceVarHandler- Parameters:
variable- the variable that changednetwork- the network
-
groundArc
-
swap
private void swap(int i, int j) -
ungroundArc
public void ungroundArc(int arcID) -
listVariables
- Specified by:
listVariablesin interfaceVarHandler- Returns:
- the list of variables handled by this handler
-
isGrounded
public boolean isGrounded(int arcID) -
getPruningEvent
Description copied from interface:VarHandlerRetrieves the consistency pruning event of a handler variable that causes the handler to be reevaluated. For instance, X- and W-variables will listen to BOUND events while S-variables typically consider ANY events.- Specified by:
getPruningEventin interfaceVarHandler- Parameters:
var- a handler variable- Returns:
- the pruning event which causes reevaluation of the handler
-