Class FSM

java.lang.Object
org.jacop.util.fsm.FSM

public class FSM extends Object
Deterministic Finite Acyclic graph.
Version:
4.9
  • Field Details

    • idNumber

      static AtomicInteger idNumber
      It specifies number of states created in DFA class.
    • initState

      public FSMState initState
      It specifies the intial state of DFA.
    • finalStates

      public Set<FSMState> finalStates
      It specifies final states of DFA.
    • allStates

      public Set<FSMState> allStates
      It specifies all states including the initial one and final ones.
  • Constructor Details

    • FSM

      public FSM(FSMState initState, Set<FSMState> finalStates, Set<FSMState> allStates)
      It creates a Finite State Machine.
      Parameters:
      initState - it specifies the initial state.
      finalStates - it specifies the final states.
      allStates - it specifies all the states.
    • FSM

      public FSM()
      It creates a Finite State Machine used by Regular constraint constructor.
  • Method Details

    • union

      public FSM union(FSM other)
      It computes a union of two Finite State Machines.
      Parameters:
      other - the other FSM which is used in the union computation.
      Returns:
      the resulting FSM.
    • concatenation

      public FSM concatenation(FSM other)
      It does concatenation of two FSM.
      Parameters:
      other - the FSM with which the concatenation takes place.
      Returns:
      the resulting FSM.
    • star

      public FSM star()
      It performs star operation on this FSM.
      Returns:
      the resulting FSM.
    • getState

      public FSMState getState(int id)
      It gets state of a given id.
      Parameters:
      id - the id of the searched state.
      Returns:
      the state of FSM with a given id.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • resize

      public void resize()
      It resizes the Finite State Machine. All states get a new id between 0..n-1, where n is the number of states.
    • transformIntoTuples

      public int[][] transformIntoTuples(IntVar[] vars)
      It creates an array of tuples representing this Regular context. It generates only the tuples which are allowed in the current context of the store.
      Parameters:
      vars - variables in which context a list of tuples is created.
      Returns:
      an array of tuples.
    • recursiveCall

      private void recursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, List<int[]> tuples)
    • transformIntoMDD

      public MDD transformIntoMDD(IntVar[] vars)
      It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built. After all tuples are added MDD is being reduced. The standard MDD creating procedure employed in paper presenting MDD based extensional constraint. It generates only the tuples which are allowed in the current context of the store.
      Parameters:
      vars - variables in which context MDD is being created from Regular constraint.
      Returns:
      MDD representing the same constraint as Regular.
    • recursiveCall

      private void recursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, MDD result)
    • transformDirectlyIntoMDD

      public MDD transformDirectlyIntoMDD(IntVar[] vars)
      It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built. After all tuples are added MDD is being reduced. The standard MDD creating procedure employed in paper presenting MDD based extensional constraint. It generates only the tuples which are allowed in the current context of the store.
      Parameters:
      vars - variables in which context MDD is being created from Regular constraint.
      Returns:
      MDD representing the same constraint as Regular.