Package org.jacop.constraints.regular
Class RegState
- java.lang.Object
-
- org.jacop.constraints.regular.RegState
-
- Direct Known Subclasses:
RegStateDom
,RegStateInt
public abstract class RegState extends java.lang.Object
The state class representing a state in the regular automaton within Regular constraint.- Version:
- 4.7
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static boolean
debugAll
int
id
The unique id of the state.int
inDegree
It specifies the number of edges incoming to the state.int
level
It specifies the level, the variable position this state is associated with.int
outDegree
It specifies the number of edges outgoing from the state.int
pos
The position of the state within a level.RegState[]
successors
It specifies the list of successor states for this state.
-
Constructor Summary
Constructors Constructor Description RegState()
-
Method Summary
All Methods Instance Methods Abstract Methods 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
addTransition(RegState suc, java.lang.Integer val)
It specifies that for a given value an automata will move from the current state to the successor state.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.abstract boolean
intersects(IntDomain dom, int successorNo)
It checks if the accepting values associated with an edge intersect.abstract boolean
isActive(TimeStamp<java.lang.Integer>[] activeLevels)
The function return if the state is still active.abstract void
removeTransition(int pos)
It informs the state that the edge on the given position is no longer active.abstract void
setSupports(java.util.Map<java.lang.Integer,RegEdge> hashMap, int successorNo)
abstract java.lang.String
sucDomToString(int successorNo)
abstract boolean
updateSupport(RegEdge edge, int v)
It updates a support if given state supports given value.
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
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 stateval
- interval of accepting values.
-
addTransition
public abstract void addTransition(RegState suc, java.lang.Integer val)
It specifies that for a given value an automata will move from the current state to the successor state.- Parameters:
suc
- successor stateval
- an accepting value
-
isActive
public abstract boolean isActive(TimeStamp<java.lang.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(java.util.Map<java.lang.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 java.lang.String sucDomToString(int successorNo)
- Parameters:
successorNo
- - edge position.- Returns:
- It return the string representation of the values accepted by specified edge.
-
-