ides.api.model.fsa
Interface FSAModel

All Superinterfaces:
Annotable, DESModel, DESModelPublisher, FSAPublisher
All Known Subinterfaces:
FSASupervisor

public interface FSAModel
extends DESModel, FSAPublisher

Interface for models of Finite-State Automata.


Method Summary
 void add(FSAState s)
          Add a state.
 void add(FSATransition t)
          Adds a transition the the automaton and adds the transition to the list of sources and targets in the source and target state of the transition.
 void add(SupervisoryEvent e)
          Adds an event to the event set of the automaton.
 SupervisoryEvent assembleCopyOf(DESEvent event)
          Assembles a new event with the same name and properties as the given event, which can then be added to the model.
 FSAState assembleCopyOf(FSAState state)
          Assembles a new state with the same name and properties as the given state, which can then be added to the model.
 FSATransition assembleEpsilonTransition(long source, long target)
          Assembles a new epsilon transition which can be added to the model.
 SupervisoryEvent assembleEvent(java.lang.String symbol)
          Assembles a new event which can be added to the model.
 FSAState assembleState()
          Assembles a new state which can be added to the model.
 FSATransition assembleTransition(long source, long target, long event)
          Assembles a new transition which can be added to the model.
 FSAModel clone()
          Creates and returns a copy of this FSAModel.
 SupervisoryEvent getEvent(long id)
          Get the event with the given event id.
 long getEventCount()
          Get the number of events in the event set of the FSA.
 java.util.ListIterator<SupervisoryEvent> getEventIterator()
          Get an iterator for the events in the event set of the FSA.
 SupervisoryEventSet getEventSet()
          Obtains the set of events in the model.
 FSAState getState(long id)
          Get the state with the given id.
 long getStateCount()
          Get the number of states in the FSA.
 java.util.ListIterator<FSAState> getStateIterator()
          Get an iterator for the states in the FSA.
 FSATransition getTransition(long id)
          Get the transition with the given id.
 long getTransitionCount()
          Get the number of transitions in the FSA.
 java.util.ListIterator<FSATransition> getTransitionIterator()
          Get an iterator for the transitions in the FSA.
 void remove(FSAState s)
          removes the state from the automaton and all transitions leading to the state and originating from the state
 void remove(FSATransition t)
          Removes a transition from the automaton.
 void remove(SupervisoryEvent e)
          Removes an event from the automaton.
 
Methods inherited from interface ides.api.plugin.model.DESModel
getModelType, getName, getParentModel, metadataChanged, modelSaved, needsSave, setName, setParentModel
 
Methods inherited from interface ides.api.core.Annotable
getAnnotation, hasAnnotation, removeAnnotation, setAnnotation
 
Methods inherited from interface ides.api.plugin.model.DESModelPublisher
addSubscriber, getDESModelSubscribers, removeSubscriber
 
Methods inherited from interface ides.api.model.fsa.FSAPublisher
addSubscriber, fireFSAEventSetChanged, fireFSAStructureChanged, getFSASubscribers, removeSubscriber
 

Method Detail

assembleState

FSAState assembleState()
Assembles a new state which can be added to the model. The state is not automatically added to the model.

Returns:
a new state

assembleCopyOf

FSAState assembleCopyOf(FSAState state)
Assembles a new state with the same name and properties as the given state, which can then be added to the model. The state is not automatically added to the model.

Parameters:
state - the state whose properties are to be copied.
Returns:
A new FSAState with the same name and controllable and obsersable properties as the given state.

assembleEvent

SupervisoryEvent assembleEvent(java.lang.String symbol)
Assembles a new event which can be added to the model. The event is not automatically added to the model.

Parameters:
symbol - the name for the event
Returns:
a new event with the given name

assembleCopyOf

SupervisoryEvent assembleCopyOf(DESEvent event)
Assembles a new event with the same name and properties as the given event, which can then be added to the model. The event is not automatically added to the model.

Parameters:
event - the event whose properties are to be copied.
Returns:
A new FSAState with the same name as the given state. If the given event is a SupervisoryEvent, the new event will have the same controllable and observable properties as the given event.

assembleTransition

FSATransition assembleTransition(long source,
                                 long target,
                                 long event)
Assembles a new transition which can be added to the model. The transition is not automatically added to the model.

Parameters:
source - the id of the source state of the transition
target - the id of the target state of the transition
event - the id of the event of the transition
Returns:
a new transition with the given properties
Throws:
java.lang.IllegalArgumentException - when the given source, target or event are not part of the model

assembleEpsilonTransition

FSATransition assembleEpsilonTransition(long source,
                                        long target)
Assembles a new epsilon transition which can be added to the model. The transition is not automatically added to the model. An epsilon transition is a transition with no associated event (null). It is interpreted as a transition on the epsilon (empty) string.

Parameters:
source - the id of the source state of the transition
target - the id of the target state of the transition
Returns:
a new transition with the given properties and no event
Throws:
java.lang.IllegalArgumentException - when the given source or target are not part of the model

add

void add(FSAState s)
Add a state.

Parameters:
s - a state that needs to be added.

getStateCount

long getStateCount()
Get the number of states in the FSA.

Returns:
the number of states in the automaton

getTransitionCount

long getTransitionCount()
Get the number of transitions in the FSA.

Returns:
the number of transitions in the automaton

getEventCount

long getEventCount()
Get the number of events in the event set of the FSA.

Returns:
the number of events in the automaton

remove

void remove(FSAState s)
removes the state from the automaton and all transitions leading to the state and originating from the state

Parameters:
s - the state to be removed

getStateIterator

java.util.ListIterator<FSAState> getStateIterator()
Get an iterator for the states in the FSA.

Returns:
a custom list iterator for the states

getState

FSAState getState(long id)
Get the state with the given id.

Parameters:
id - the id of the state
Returns:
the state, null if it doesn't exist

add

void add(FSATransition t)
Adds a transition the the automaton and adds the transition to the list of sources and targets in the source and target state of the transition.

Parameters:
t - the transition to be added to the state

remove

void remove(FSATransition t)
Removes a transition from the automaton. Removes the transition from the list of source transitions and the list of target transitions in the right states.

Parameters:
t - the transition to be removed

getTransition

FSATransition getTransition(long id)
Get the transition with the given id.

Parameters:
id - the id of the transition.
Returns:
the transition, null if the transition is not in the automaton.

getTransitionIterator

java.util.ListIterator<FSATransition> getTransitionIterator()
Get an iterator for the transitions in the FSA.

Returns:
a custom list iterator for the transitions.

add

void add(SupervisoryEvent e)
Adds an event to the event set of the automaton.

Parameters:
e - the event that shall be added to the automaton.

remove

void remove(SupervisoryEvent e)
Removes an event from the automaton.

Parameters:
e - the event to be removed

getEventIterator

java.util.ListIterator<SupervisoryEvent> getEventIterator()
Get an iterator for the events in the event set of the FSA.

Returns:
a custom list iterator for the events.

getEventSet

SupervisoryEventSet getEventSet()
Obtains the set of events in the model. If there are no events in the model, returns an empty set.

Specified by:
getEventSet in interface DESModel
Returns:
the set of events in the model.

getEvent

SupervisoryEvent getEvent(long id)
Get the event with the given event id.

Parameters:
id - the id of the event
Returns:
the event, null if it doesn't exist

clone

FSAModel clone()
Creates and returns a copy of this FSAModel.

Returns:
a copy of the model