|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.kernel.CompositeEntity
ptolemy.domains.modal.kernel.FSMActor
ptolemy.domains.modal.modal.ModalController
ptolemy.domains.ptera.kernel.PteraController
public class PteraController
This controller is used in every Ptera modal model. It contains an PteraDirector
to execute the events in it.
Each Ptera modal model has one or more Ptera controllers. One of those
controllers is the top level controller, which can be obtained with ModalModel.getController()
. The other controllers are refinements of
events.
Red (tfeng) |
Yellow (tfeng) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.domains.modal.kernel.FSMActor |
---|
FSMActor.PortScope |
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity |
---|
CompositeEntity.ContainedObjectsIterator |
Field Summary | |
---|---|
private Director |
_executiveDirector
The last updated executive director. |
private long |
_executiveDirectorVersion
The version of the workspace when _executiveDirector was updated. |
PteraDirector |
director
The Ptera director contained by this controller. |
Parameter |
LIFO
A Boolean parameter that decides whether simultaneous events should be placed in the event queue in the last-in-first-out (LIFO) fashion or not. |
Fields inherited from class ptolemy.domains.modal.modal.ModalController |
---|
_mirrorDisable |
Fields inherited from class ptolemy.domains.modal.kernel.FSMActor |
---|
_currentState, _initializables, _inputTokenMap, _lastChosenTransition, _stopRequested, finalStateNames, initialStateName, stateDependentCausality |
Fields inherited from class ptolemy.kernel.CompositeEntity |
---|
_levelCrossingLinks |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
PteraController(CompositeEntity container,
java.lang.String name)
Construct an Ptera controller with a name and a container. |
|
PteraController(Workspace workspace)
Construct an Ptera controller in the specified workspace with no container and an empty string as a name. |
Method Summary | |
---|---|
protected java.util.TreeMap<java.lang.Class<? extends Entity>,java.lang.String> |
_getRefinementClasses()
Return a map from the classes of the entities to be dropped into a state and the class names of the refinements that can be used to contain those entities. |
private void |
_init()
Create director for this controller. |
protected void |
_setCurrentEvent(Event event)
Set the event currently being executed. |
void |
attributeChanged(Attribute attribute)
React to a change in an attribute. |
java.lang.Object |
clone(Workspace workspace)
Clone the controller into the specified workspace. |
void |
fire()
Invoke the fire() method of the enclosed PteraDirector . |
CausalityInterface |
getCausalityInterface()
Return a causality interface for this actor. |
Director |
getDirector()
Return the director responsible for the execution of this actor. |
Director |
getExecutiveDirector()
Return the executive director. |
State |
getInitialState()
Return null as the initial state. |
void |
initialize()
Initialize this controller by initializing the director that it contains, which sets the initial events, and initializing all the refinements. |
boolean |
isFireFunctional()
Return the result of isFireFunctional() from the director. |
boolean |
isStrict()
Return the result of isStrict() from the director. |
int |
iterate(int count)
Invoke a specified number of iterations of the actor by calling iterate() of the director. |
ComponentRelation |
newRelation(java.lang.String name)
Create a new instance of SchedulingRelation with the specified
name in this actor, and return it. |
boolean |
postfire()
Invoke postfire() of the director. |
boolean |
prefire()
Invoke prefire() of the director. |
void |
preinitialize()
Preinitialize the controller by invoking preinitialize() of the director and that of the refinements. |
void |
stop()
Stop execution by invoking stop() of the director. |
void |
stopFire()
Request that execution of the current iteration stop as soon as possible by invoking stopFire() of the director. |
boolean |
synchronizeToRealtime()
Return whether the synchronizeToRealtime attribute of this controller is set or not. |
void |
terminate()
Invoke terminate() of the director. |
java.util.Set<Inequality> |
typeConstraints()
Return the type constraints of this actor. |
void |
wrapup()
Wrap up the controller by invoking wrapup() of the director and that of the refinements. |
Methods inherited from class ptolemy.domains.modal.modal.ModalController |
---|
_checkContainer, addRefinement, dropObject, getRefinedState, newPort, setMirrorDisable |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_addPort, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public Parameter LIFO
public PteraDirector director
private Director _executiveDirector
private long _executiveDirectorVersion
Constructor Detail |
---|
public PteraController(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container, which must be an PteraModalModel
.name
- The name.
IllegalActionException
- If the container is incompatible with
this actor.
NameDuplicationException
- If the name coincides with an actor
already in the container.public PteraController(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace that will list the controller.
IllegalActionException
- If the container is incompatible with
this actor.
NameDuplicationException
- If the name coincides with an actor
already in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If thrown by the superclass
attributeChanged() method, or if the value of the LIFO parameter cannot
be read.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class FSMActor
workspace
- The workspace for the new controller.
java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
PteraDirector
.
fire
in interface Executable
fire
in class FSMActor
IllegalActionException
- If the PteraDirector throws it.PteraDirector.fire()
public CausalityInterface getCausalityInterface()
BreakCausalityInterface
.
FIXME: A causality interface special for Ptera should be returned
instead.
getCausalityInterface
in interface Actor
getCausalityInterface
in class FSMActor
public Director getDirector()
getDirector
in interface Actor
getDirector
in class FSMActor
public Director getExecutiveDirector()
getDirector()
).
Otherwise, the executive director is the director of the Ptera
controller at a higher level in the refinement hierarchy.
getExecutiveDirector
in interface Actor
getExecutiveDirector
in class FSMActor
public State getInitialState()
getInitialState
in class FSMActor
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class FSMActor
IllegalActionException
- If the director or initialize() of the
superclass throws it.public boolean isFireFunctional()
isFireFunctional
in interface Executable
isFireFunctional
in class FSMActor
public boolean isStrict() throws IllegalActionException
isStrict
in interface Executable
isStrict
in class FSMActor
IllegalActionException
- Thrown if causality interface
cannot be computed.public int iterate(int count) throws IllegalActionException
iterate
in interface Executable
iterate
in class FSMActor
count
- The number of iterations to perform.
IllegalActionException
- If iterating is not
permitted, or if prefire(), fire(), or postfire() throw it.public ComponentRelation newRelation(java.lang.String name) throws IllegalActionException, NameDuplicationException
SchedulingRelation
with the specified
name in this actor, and return it. This method is write-synchronized on
the workspace.
newRelation
in class FSMActor
name
- The name of the new scheduling relation.
IllegalActionException
- If the name argument is null.
NameDuplicationException
- If name collides with that
of a scheduling relation already in this actor.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class FSMActor
IllegalActionException
- If postfire() of the director throws
it.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class FSMActor
IllegalActionException
- If prefire() of the director throws
it.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class FSMActor
IllegalActionException
- If preinitialize() of the director or
refinements throws it.public void stop()
stop
in interface Executable
stop
in class FSMActor
public void stopFire()
stopFire
in interface Executable
stopFire
in class FSMActor
public boolean synchronizeToRealtime()
public void terminate()
terminate
in interface Executable
terminate
in class FSMActor
public java.util.Set<Inequality> typeConstraints()
typeConstraints
in interface TypedActor
typeConstraints
in class FSMActor
Inequality
public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class FSMActor
IllegalActionException
- If wrapup() of the director or
refinements throws it.protected java.util.TreeMap<java.lang.Class<? extends Entity>,java.lang.String> _getRefinementClasses()
_getRefinementClasses
in class ModalController
protected void _setCurrentEvent(Event event)
event
- The current event.private void _init() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If the controller is incompatible
with the director.
NameDuplicationException
- If the name of the director
coincides with a director already in the controller.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |