Package org.jacop.util.fsm
Class FSM
- java.lang.Object
-
- org.jacop.util.fsm.FSM
-
public class FSM extends java.lang.ObjectDeterministic Finite Acyclic graph.- Version:
- 4.8
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Set<FSMState>allStatesIt specifies all states including the initial one and final ones.java.util.Set<FSMState>finalStatesIt specifies final states of DFA.(package private) static java.util.concurrent.atomic.AtomicIntegeridNumberIt specifies number of states created in DFA class.FSMStateinitStateIt specifies the intial state of DFA.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FSMconcatenation(FSM other)It does concatenation of two FSM.FSMStategetState(int id)It gets state of a given id.private voidrecursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, java.util.List<int[]> tuples)private voidrecursiveCall(int prevSuc, int level, int stateNumber, IntervalDomain[][][] outarc, int[] tuple, MDD result)voidresize()It resizes the Finite State Machine.FSMstar()It performs star operation on this FSM.java.lang.StringtoString()MDDtransformDirectlyIntoMDD(IntVar[] vars)It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built.MDDtransformIntoMDD(IntVar[] vars)It generates one by one tuples allowed by a Regular constraint, which are added to the MDD being built.int[][]transformIntoTuples(IntVar[] vars)It creates an array of tuples representing this Regular context.FSMunion(FSM other)It computes a union of two Finite State Machines.
-
-
-
Field Detail
-
idNumber
static java.util.concurrent.atomic.AtomicInteger idNumber
It specifies number of states created in DFA class.
-
initState
public FSMState initState
It specifies the intial state of DFA.
-
finalStates
public java.util.Set<FSMState> finalStates
It specifies final states of DFA.
-
allStates
public java.util.Set<FSMState> allStates
It specifies all states including the initial one and final ones.
-
-
Constructor Detail
-
FSM
public FSM(FSMState initState, java.util.Set<FSMState> finalStates, java.util.Set<FSMState> allStates)
It creates a Finite State Machine.- Parameters:
initState- it specifies the initial state.allStates- it specifies all the states.finalStates- it specifies the final states.
-
FSM
public FSM()
It creates a Finite State Machine used by Regular constraint constructor.
-
-
Method Detail
-
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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.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, java.util.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.
-
-