public class Machine extends Annotated
Modifier and Type | Field and Description |
---|---|
static int |
TIMEOUT
The timeout for state-space searches, set to five seconds.
|
Constructor and Description |
---|
Machine()
Creates a default finite state Machine.
|
Machine(java.lang.String name)
Creates a named finite state Machine.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Event event)
Reports whether this Machine accepts an Event in its current State.
|
Machine |
addState(State state)
Adds a named State to the Machine.
|
protected Warning |
checkDifference(Notice topInfo,
Alphabet difference)
Checks the difference between the Protocol alphabet and the Machine
alphabet.
|
protected Warning |
checkInitialState(Notice topInfo)
Checks that this Machine has an initial State.
|
Warning |
checkStateCoverage(Notice topInfo)
Checks the coverage of States after simulating this Machine to find
the state cover.
|
protected Warning |
checkTargetStates(Notice topInfo)
Checks that the Transitions of this Machine refer to properly-named
target States.
|
Warning |
checkTransitionCoverage(Notice topInfo)
Checks the coverage of Transitions after simulating this Machine with a
Language of a given maximum size.
|
Machine |
clear()
Resets every State and Transition in this Machine to its unmarked
status.
|
boolean |
fireEvent(Event event)
Fires an event on this Machine.
|
Alphabet |
getAlphabet()
Returns the Alphabet of this Machine.
|
State |
getCurrentState()
Returns the current State;
|
State |
getInitialState()
Returns the initial State.
|
State |
getState(java.lang.String name)
Returns the unique State with the given name.
|
Language |
getStateCover()
Calculates the state cover for this Machine.
|
protected Language |
getStateCover(Alphabet alphabet)
Calculates the state cover for this Machine.
|
java.util.Set<State> |
getStates()
Returns the set of States belonging to this Machine.
|
Language |
getTransitionCover(int length)
Calculates the n-transition cover for this Machine.
|
java.util.Set<Transition> |
getTransitions()
Returns the set of Transitions belonging to this Machine.
|
Machine |
reset()
Resets this Machine to its initial State.
|
Machine |
validateMachine(Protocol protocol)
Validates the States and Transitions of this Machine for completeness.
|
equals, getName, hashCode, setName, setName, toString
safeEquals, safeHashCode, semanticError
public static final int TIMEOUT
public Machine()
public Machine(java.lang.String name)
name
- the name of the Machine.public Machine addState(State state)
state
- the state to add.public State getState(java.lang.String name)
name
- the name of the State.public java.util.Set<State> getStates()
public java.util.Set<Transition> getTransitions()
public State getInitialState()
public State getCurrentState()
public Machine reset()
public Machine clear()
public boolean accept(Event event)
event
- the Event.public boolean fireEvent(Event event)
event
- the event.public Alphabet getAlphabet()
public Language getStateCover()
public Language getTransitionCover(int length)
length
- the maximum Transition path length to explore.protected Language getStateCover(Alphabet alphabet)
alphabet
- the Alphabet of this Machine.public Machine validateMachine(Protocol protocol)
protocol
- the associated Protocol, for comparison.protected Warning checkDifference(Notice topInfo, Alphabet difference)
topInfo
- the top-level Notice.difference
- the extra actions present in the Protocol alphabet.protected Warning checkInitialState(Notice topInfo)
topInfo
- the top-level Notice.protected Warning checkTargetStates(Notice topInfo)
topInfo
- the top-level Notice.public Warning checkStateCoverage(Notice topInfo)
topInfo
- the top-level Notice.public Warning checkTransitionCoverage(Notice topInfo)
topInfo
- the top-level Notice.