Class RegState

java.lang.Object
org.jacop.constraints.regular.RegState
Direct Known Subclasses:
RegStateDom, RegStateInt

public abstract class RegState extends Object
The state class representing a state in the regular automaton within Regular constraint.
Version:
4.9
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final boolean
     
    int
    The unique id of the state.
    int
    It specifies the number of edges incoming to the state.
    int
    It specifies the level, the variable position this state is associated with.
    int
    It specifies the number of edges outgoing from the state.
    int
    The position of the state within a level.
    It specifies the list of successor states for this state.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    add(IntDomain varDom, int successorNo)
    It adds to domain values which are accepted by a given edge.
    abstract void
    It specifies that for a given value an automata will move from the current state to the successor state.
    abstract void
    It specifies that for a given values from an interval an automata will move from the current state to the successor state.
    abstract boolean
    intersects(IntDomain dom, int successorNo)
    It checks if the accepting values associated with an edge intersect.
    abstract boolean
    isActive(TimeStamp<Integer>[] activeLevels)
    The function return if the state is still active.
    abstract void
    It informs the state that the edge on the given position is no longer active.
    abstract void
    setSupports(Map<Integer,RegEdge> hashMap, int successorNo)
     
    abstract String
    sucDomToString(int successorNo)
     
    abstract boolean
    updateSupport(RegEdge edge, int v)
    It updates a support if given state supports given value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • successors

      public RegState[] successors
      It specifies the list of successor states for this state.
    • outDegree

      public int outDegree
      It specifies the number of edges outgoing from the state.
    • inDegree

      public int inDegree
      It specifies the number of edges incoming to the state.
    • id

      public int id
      The unique id of the state.
    • level

      public int level
      It specifies the level, the variable position this state is associated with.
    • pos

      public int pos
      The position of the state within a level.
    • debugAll

      static final boolean debugAll
      See Also:
  • Constructor Details

    • RegState

      public RegState()
  • Method Details

    • addTransitions

      public abstract void addTransitions(RegState suc, IntervalDomain val)
      It specifies that for a given values from an interval an automata will move from the current state to the successor state.
      Parameters:
      suc - successor state
      val - interval of accepting values.
    • addTransition

      public abstract void addTransition(RegState suc, Integer val)
      It specifies that for a given value an automata will move from the current state to the successor state.
      Parameters:
      suc - successor state
      val - an accepting value
    • isActive

      public abstract boolean isActive(TimeStamp<Integer>[] activeLevels)
      The function return if the state is still active. It depends on how many active levels remains for state level and the position of the state.
      Parameters:
      activeLevels - -
      Returns:
      true is the state is still active.
    • removeTransition

      public abstract void removeTransition(int pos)
      It informs the state that the edge on the given position is no longer active.
      Parameters:
      pos - position of the edge.
    • intersects

      public abstract boolean intersects(IntDomain dom, int successorNo)
      It checks if the accepting values associated with an edge intersect.
      Parameters:
      dom - domain against which interesection is performed.
      successorNo - a position of the edge.
      Returns:
      true if at least one value associated with an edge intersects with domain.
    • setSupports

      public abstract void setSupports(Map<Integer,RegEdge> hashMap, int successorNo)
      Parameters:
      hashMap - It contains supports for all values of a given variable.
      successorNo - it specifies the edge position.
    • updateSupport

      public abstract boolean updateSupport(RegEdge edge, int v)
      It updates a support if given state supports given value.
      Parameters:
      edge - information about support is stored here.
      v - value for which support is looked for.
      Returns:
      It returns true if state has an edge which supports given value.
    • add

      public abstract void add(IntDomain varDom, int successorNo)
      It adds to domain values which are accepted by a given edge.
      Parameters:
      varDom - - domain collecting suported values.
      successorNo - - position of an edge from which values are collected.
    • sucDomToString

      public abstract String sucDomToString(int successorNo)
      Parameters:
      successorNo - - edge position.
      Returns:
      It return the string representation of the values accepted by specified edge.