
ModalModel |
ptolemy.domains.fsm.modal.ModalModel |
This is a typed composite actor designed to be a modal model.
Inside the modal model is a finite-state machine controller, and
inside each state in the FSM is a refinement model. To use this
actor, just drag it into a model, and look inside to start constructing
the controller. You may add ports to get inputs and outputs, and
add states to the controller. You may add one or more refinements
to a state (each of these refinements will be executed when this
actor is executed). Each refinement is required to have its own
director, so you will need to choose a director.
<p>
The controller is a finite-state machine (FSM), which consists of
states and transitions. One of the states is an initial state.
When this actor executes, if the current state has a refinement,
then that refinement is executed. Then the guards on all the outgoing
transitions of the current state are evaluated, and if one of those
guards is true, then the transition is taken. Taking the transition
means that the actions associated with the transition are executed
(which can result in producing outputs), and the new current state is
the state at the destination of the transition. It is an error if
more than one of the guards evaluates to true.
<p>
To add a state, click on a state button in the toolbar, or drag
in a state from the library at the left. To add a transition,
position the mouse over the source state, hold the control button,
and drag to the destination state. The destination state may be
the same state, in which case the transition is used simply to
execute its actions.
<p>
Adding or removing ports in this actor results in the same ports appearing
or disappearing in the FSM controller and in each of the refinements.
Similarly, adding or removing ports in the controller or in the
refinements results in this actor and the other refinements
reflecting the same change to the ports. That is, this actor,
the controller, and the refinments all contain the same ports.
<p>
There is one subtlety regarding ports however. If you add an
output port to a refinement, then the corresponding port in the
controller will be both an input and an output. The reason for
this is that the controller can access the results of executing
a refinement in order to choose a transition.
<p>
This class is designed to work closely with ModalController and
Refinement, since changes to ports can be initiated in this class
or in those. It works with continuous-time as well as discrete-time
models.
<p>
This class also fulfills the CTEventGenerator interfact so that
it can report events generated inside.
Author(s): Edward A. Lee
Version:$Id: ModalModel.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Red (eal)
Pt.Accepted Rating:Red (reviewmoderator)
directorClass
A director class name. The default value and the list of
choices are obtained from the suggestedModalModelDirectors()
method of the executive director. If there is no executive
director, then the default is "ptolemy.domains.fsm.kernel.FSMDirector".