Package org.jacop.constraints.regular
Class RegStateInt
java.lang.Object
org.jacop.constraints.regular.RegState
org.jacop.constraints.regular.RegStateInt
It is an implementation of the Regular state which uses a separate successor for each
value. Different values using different entries in the successor array can lead to the
same successor.
- Version:
- 4.9
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRegStateInt
(int level, int id, int sucNumber, int posInArray) It constructs an integer based representation of the state. -
Method Summary
Modifier and TypeMethodDescriptionvoid
It adds to domain values which are accepted by a given edge.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.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.boolean
intersects
(IntDomain dom, int successorNo) It checks if the accepting values associated with an edge intersect.boolean
The function return if the state is still active.void
removeTransition
(int pos) It informs the state that the edge on the given position is no longer active.void
setSupports
(Map<Integer, RegEdge> hashMap, int i) sucDomToString
(int successorNo) toString()
boolean
updateSupport
(RegEdge edge, int v) It updates a support if given state supports given value.
-
Field Details
-
toSucDom
private int[] toSucDom
-
-
Constructor Details
-
RegStateInt
public RegStateInt(int level, int id, int sucNumber, int posInArray) It constructs an integer based representation of the state.- Parameters:
level
- level of the state (position of the associated variable).id
- id of the state.sucNumber
- the number of successors.posInArray
- the position within the array of states.
-
-
Method Details
-
addTransitions
Description copied from class:RegState
It specifies that for a given values from an interval an automata will move from the current state to the successor state.- Specified by:
addTransitions
in classRegState
- Parameters:
suc
- successor stateval
- interval of accepting values.
-
addTransition
Description copied from class:RegState
It specifies that for a given value an automata will move from the current state to the successor state.- Specified by:
addTransition
in classRegState
- Parameters:
suc
- successor stateval
- an accepting value
-
isActive
Description copied from class:RegState
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. -
removeTransition
public void removeTransition(int pos) Description copied from class:RegState
It informs the state that the edge on the given position is no longer active.- Specified by:
removeTransition
in classRegState
- Parameters:
pos
- position of the edge.
-
intersects
Description copied from class:RegState
It checks if the accepting values associated with an edge intersect.- Specified by:
intersects
in classRegState
- 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
- Specified by:
setSupports
in classRegState
- Parameters:
hashMap
- It contains supports for all values of a given variable.i
- it specifies the edge position.
-
updateSupport
Description copied from class:RegState
It updates a support if given state supports given value.- Specified by:
updateSupport
in classRegState
- 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
Description copied from class:RegState
It adds to domain values which are accepted by a given edge. -
sucDomToString
- Specified by:
sucDomToString
in classRegState
- Parameters:
successorNo
- - edge position.- Returns:
- It return the string representation of the values accepted by specified edge.
-
toString
-