Package org.jacop.constraints.regular
Class RegState
java.lang.Object
org.jacop.constraints.regular.RegState
- Direct Known Subclasses:
RegStateDom
,RegStateInt
The state class representing a state in the regular automaton
within Regular constraint.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(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.RegState[]
It specifies the list of successor states for this state. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
It adds to domain values which are accepted by a given edge.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.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
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
(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.
-
Field Details
-
successors
It specifies the list of successor states for this state. -
outDegree
public int outDegreeIt specifies the number of edges outgoing from the state. -
inDegree
public int inDegreeIt specifies the number of edges incoming to the state. -
id
public int idThe unique id of the state. -
level
public int levelIt specifies the level, the variable position this state is associated with. -
pos
public int posThe position of the state within a level. -
debugAll
static final boolean debugAll- See Also:
-
-
Constructor Details
-
RegState
public RegState()
-
-
Method Details
-
addTransitions
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
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
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
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
- Parameters:
hashMap
- It contains supports for all values of a given variable.successorNo
- it specifies the edge position.
-
updateSupport
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
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
- Parameters:
successorNo
- - edge position.- Returns:
- It return the string representation of the values accepted by specified edge.
-