|
|||||||||
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.util.Attribute
ptolemy.actor.Director
ptolemy.actor.sched.StaticSchedulingDirector
ptolemy.domains.giotto.kernel.GiottoDirector
public class GiottoDirector
This class implements a director for the Giotto model of computation without Giotto modes. Schedules are generated according to the Giotto semantics. The GiottoScheduler class contains methods to compute the schedules. The GiottoReceiver class implements the data flow between actors using double-buffering.
If the parameter synchronizeToRealTime is set to true
,
then the director will not process events until the real time elapsed
since the model started matches the time stamp of the event.
This ensures that the director does not get ahead of real time,
but, of course, it does not ensure that the director keeps up with
real time.
GiottoScheduler
,
GiottoReceiver
,
Serialized Form
Red (eal) |
Yellow (cm) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
protected static double |
_DEFAULT_GIOTTO_PERIOD
The static default Giotto period is 100ms. |
private Time |
_expectedNextIterationTime
|
private int |
_iterationCount
|
private double |
_periodValue
|
private boolean |
_readyToFire
|
private long |
_realStartTime
|
private java.util.LinkedList |
_receivers
|
private Schedule |
_schedule
|
private boolean |
_synchronizeToRealTime
|
private int |
_unitIndex
|
private double |
_unitTimeIncrement
|
Parameter |
iterations
The number of times that postfire may be called before it returns false. |
Parameter |
period
The period of an iteration. |
Parameter |
synchronizeToRealTime
Specify whether the execution should synchronize to the real time. |
Fields inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_postfireReturns |
Fields inherited from class ptolemy.actor.Director |
---|
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution |
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 | |
---|---|
GiottoDirector()
Construct a director in the default workspace with an empty string as its name. |
|
GiottoDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
GiottoDirector(Workspace workspace)
Construct a director in the given workspace with an empty name. |
Method Summary | |
---|---|
private int |
_getActorFrequency(NamedObj actor)
Return the frequency of the specified actor by accessing a parameter named "frequency". |
private void |
_init()
|
private void |
_requestFiring()
|
void |
attributeChanged(Attribute attribute)
If the specified attribute is filename, then close the current file (if there is one) and open the new one. |
Dependency |
delayDependency(double delay)
Return a boolean dependency representing a model-time delay of the specified amount. |
void |
fire()
Fire a complete iteration and advance time to the current time plus the period value. |
Time |
fireAt(Actor actor,
Time time)
Request a firing of the given actor at the given absolute time. |
int |
getIntPeriod()
Get the period of the giotto director in ms. |
Time |
getModelNextIterationTime()
Return the next time that this director expects activity. |
double |
getPeriod()
Get the period of the giotto director in ms. |
void |
initialize()
Initialize the actors associated with this director. |
Receiver |
newReceiver()
Return a new receiver consistent with the Giotto domain. |
boolean |
postfire()
Return false if the system has finished executing, either by reaching the iteration limit, or by having an actor in the model return false in postfire. |
boolean |
prefire()
This method always return true. |
void |
preinitialize()
Preinitialize the actors associated with this director. |
java.lang.String[] |
suggestedModalModelDirectors()
Return an array of suggested directors to be used with ModalModel. |
boolean |
transferInputs(IOPort port)
Transfer data from an input port of the container to the ports it is connected to on the inside. |
boolean |
transferOutputs(IOPort port)
Transfer data from this port to the ports it is connected to on the outside. |
Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_setScheduler, addDebugListener, clone, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener, setScheduler |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.TimedDirector |
---|
getModelTime, getTimeResolution |
Field Detail |
---|
public Parameter iterations
public Parameter period
public Parameter synchronizeToRealTime
protected static final double _DEFAULT_GIOTTO_PERIOD
private Time _expectedNextIterationTime
private int _iterationCount
private double _periodValue
private boolean _readyToFire
private long _realStartTime
private java.util.LinkedList _receivers
private Schedule _schedule
private boolean _synchronizeToRealTime
private int _unitIndex
private double _unitTimeIncrement
Constructor Detail |
---|
public GiottoDirector()
public GiottoDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the director.name
- Name of this director.
IllegalActionException
- If the director is not compatible
with the specified container.
NameDuplicationException
- If the name collides with an
attribute in the container.public GiottoDirector(Workspace workspace)
workspace
- The workspace for this object.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class Director
attribute
- The attribute that has changed.
IllegalActionException
- If the specified attribute
is filename and the file cannot be opened.public Dependency delayDependency(double delay)
delayDependency
in interface TimedDirector
delay
- A non-negative delay.
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class StaticSchedulingDirector
IllegalActionException
- If this director does not have a
container.public Time fireAt(Actor actor, Time time) throws IllegalActionException
fireAt
in class Director
actor
- The actor scheduled to be fired.time
- The requested time.
IllegalActionException
- If the operation is not
permissible (e.g. the given time is in the past).Director.fireAtCurrentTime(Actor)
public int getIntPeriod()
public Time getModelNextIterationTime()
getModelNextIterationTime
in class Director
Director.getModelTime()
public double getPeriod()
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class Director
IllegalActionException
- If the initialize() method of
one of the associated actors throws it.public Receiver newReceiver()
newReceiver
in class Director
public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class StaticSchedulingDirector
IllegalActionException
- If the iterations parameter does
not have a valid token.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class StaticSchedulingDirector
IllegalActionException
- If time is set backwards.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class Director
IllegalActionException
- If the preinitialize() method of
one of the associated actors throws it.public java.lang.String[] suggestedModalModelDirectors()
suggestedModalModelDirectors
in class Director
Director.suggestedModalModelDirectors()
public boolean transferInputs(IOPort port) throws IllegalActionException
transferInputs
in class Director
port
- The port to transfer tokens from.
IllegalActionException
- If the port is not an opaque
input port.public boolean transferOutputs(IOPort port) throws IllegalActionException
transferOutputs
in class Director
port
- The port to transfer tokens from.
IllegalActionException
- If the port is not an opaque
output port.private int _getActorFrequency(NamedObj actor) throws IllegalActionException
IllegalActionException
private void _init()
private void _requestFiring() throws IllegalActionException
IllegalActionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |