Class DomainStructure

java.lang.Object
org.jacop.constraints.netflow.DomainStructure
All Implemented Interfaces:
VarHandler

public class DomainStructure extends Object implements 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.8
  • Field Details

    • variable

      public final IntVar variable
    • arcs

      public final Arc[] arcs
    • domains

      public final IntDomain[] domains
    • behavior

      public final DomainStructure.Behavior behavior
    • notGrounded

      public int notGrounded
  • Constructor Details

    • DomainStructure

      public DomainStructure(IntVar variable, List<Domain> domList, List<Arc> arcList)
      Creates an S-variable
      Parameters:
      variable - variable to create for
      domList - list of domains
      arcList - list of arcs
    • DomainStructure

      public DomainStructure(IntVar variable, IntDomain[] domains, Arc[] arcs)
    • DomainStructure

      public DomainStructure(IntVar variable, IntDomain[] domains, Arc[] arcs, DomainStructure.Behavior behavior)
  • Method Details

    • processEvent

      public void processEvent(IntVar variable, MutableNetwork network)
      Description copied from interface: VarHandler
      Informs the handler that one of its variable has changed and asks the handler to update the state of the network accordingly.
      Specified by:
      processEvent in interface VarHandler
      Parameters:
      variable - the variable that changed
      network - the network
    • groundArc

      private void groundArc(int arcID, boolean active, MutableNetwork network)
    • swap

      private void swap(int i, int j)
    • ungroundArc

      public void ungroundArc(int arcID)
    • listVariables

      public List<IntVar> listVariables()
      Specified by:
      listVariables in interface VarHandler
      Returns:
      the list of variables handled by this handler
    • isGrounded

      public boolean isGrounded(int arcID)
    • getPruningEvent

      public int getPruningEvent(Var var)
      Description copied from interface: VarHandler
      Retrieves 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:
      getPruningEvent in interface VarHandler
      Parameters:
      var - a handler variable
      Returns:
      the pruning event which causes reevaluation of the handler