Package org.jacop.constraints.regular
Class RegStateInt
- java.lang.Object
-
- org.jacop.constraints.regular.RegState
-
- org.jacop.constraints.regular.RegStateInt
-
public class RegStateInt extends RegState
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.8
-
-
Constructor Summary
Constructors Constructor Description RegStateInt(int level, int id, int sucNumber, int posInArray)It constructs an integer based representation of the state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IntDomain varDom, int successorNo)It adds to domain values which are accepted by a given edge.voidaddTransition(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.voidaddTransitions(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.booleanintersects(IntDomain dom, int successorNo)It checks if the accepting values associated with an edge intersect.booleanisActive(TimeStamp<java.lang.Integer>[] activeLevels)The function return if the state is still active.voidremoveTransition(int pos)It informs the state that the edge on the given position is no longer active.voidsetSupports(java.util.Map<java.lang.Integer,RegEdge> hashMap, int i)java.lang.StringsucDomToString(int successorNo)java.lang.StringtoString()booleanupdateSupport(RegEdge edge, int v)It updates a support if given state supports given value.
-
-
-
Constructor Detail
-
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 Detail
-
addTransitions
public void addTransitions(RegState suc, IntervalDomain val)
Description copied from class:RegStateIt specifies that for a given values from an interval an automata will move from the current state to the successor state.- Specified by:
addTransitionsin classRegState- Parameters:
suc- successor stateval- interval of accepting values.
-
addTransition
public void addTransition(RegState suc, java.lang.Integer val)
Description copied from class:RegStateIt specifies that for a given value an automata will move from the current state to the successor state.- Specified by:
addTransitionin classRegState- Parameters:
suc- successor stateval- an accepting value
-
isActive
public boolean isActive(TimeStamp<java.lang.Integer>[] activeLevels)
Description copied from class:RegStateThe 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:RegStateIt informs the state that the edge on the given position is no longer active.- Specified by:
removeTransitionin classRegState- Parameters:
pos- position of the edge.
-
intersects
public boolean intersects(IntDomain dom, int successorNo)
Description copied from class:RegStateIt checks if the accepting values associated with an edge intersect.- Specified by:
intersectsin 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
public void setSupports(java.util.Map<java.lang.Integer,RegEdge> hashMap, int i)
- Specified by:
setSupportsin classRegState- Parameters:
hashMap- It contains supports for all values of a given variable.i- it specifies the edge position.
-
updateSupport
public boolean updateSupport(RegEdge edge, int v)
Description copied from class:RegStateIt updates a support if given state supports given value.- Specified by:
updateSupportin 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
public void add(IntDomain varDom, int successorNo)
Description copied from class:RegStateIt adds to domain values which are accepted by a given edge.
-
sucDomToString
public java.lang.String sucDomToString(int successorNo)
- Specified by:
sucDomToStringin classRegState- Parameters:
successorNo- - edge position.- Returns:
- It return the string representation of the values accepted by specified edge.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-