Package ptolemy.domains.giotto.kernel
Class GiottoScheduler
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.sched.Scheduler
-
- ptolemy.domains.giotto.kernel.GiottoScheduler
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class GiottoScheduler extends Scheduler
This class generates schedules for the actors in a CompositeActor according to the Giotto semantics.A schedule is represented by a list. Consider the following CompositeActor:
+-----------------------+ | A | +-----------------------+ +-----------------------+ | B | +-----------------------+ +---------+ +---------+ | C | | C | +---------+ +---------+
There are three actors A, B, and C, where C runs twice as often as A and B. The list representing the schedule for this CompositeActor looks as follows:+-------+ +-------+ | | | --------------------------->| | |nil| +-|-----+ +-|-----+ | | V V +-------+ +-------+ +-------+ +-------+ | | | ---->| | | ---->| | |nil| | | |nil| +-|-----+ +-|-----+ +-|-----+ +-|-----+ | | | | V V V V +---+ +---+ +---+ +---+ | A | | B | | c | | c | +---+ +---+ +---+ +---+
- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- Christoph Kirsch, Haiyang Zheng
- Pt.AcceptedRating:
- Red (eal)
- Pt.ProposedRating:
- Yellow (cm)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
_DEFAULT_GIOTTO_FREQUENCY
The default Giotto frequency.-
Fields inherited from class ptolemy.actor.sched.Scheduler
_DEFAULT_SCHEDULER_NAME
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description GiottoScheduler()
Construct a Giotto scheduler with no container (director) in the default workspace.GiottoScheduler(Workspace workspace)
Construct a Giotto scheduler in the given workspace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
_getMinTimeStep(double period)
Return the unit of time increment for director.protected Schedule
_getSchedule()
Return the scheduling sequence.int
getLCM()
Returns the LCM value.-
Methods inherited from class ptolemy.actor.sched.Scheduler
clone, getSchedule, isValid, setContainer, setValid
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
_DEFAULT_GIOTTO_FREQUENCY
protected static final int _DEFAULT_GIOTTO_FREQUENCY
The default Giotto frequency. Actors without a frequency parameter will execute with this frequency.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GiottoScheduler
public GiottoScheduler()
Construct a Giotto scheduler with no container (director) in the default workspace.
-
GiottoScheduler
public GiottoScheduler(Workspace workspace)
Construct a Giotto scheduler in the given workspace. If the workspace argument is null, use the default workspace. The scheduler is added to the list of objects in the workspace. Increment the version number of the workspace.- Parameters:
workspace
- Object for synchronization and version tracking.
-
-
Method Detail
-
getLCM
public int getLCM()
Returns the LCM value.- Returns:
- an int representing the LCM value
-
_getMinTimeStep
protected double _getMinTimeStep(double period)
Return the unit of time increment for director. This method will be called by the director. It should not be called until the director call getSchedule() and the returned schedule is invalid. It is not synchronized on the workspace.- Parameters:
period
- Giotto model period given in 'period' parameter of director- Returns:
- unit of time increment for director.
-
_getSchedule
protected Schedule _getSchedule() throws NotSchedulableException
Return the scheduling sequence. This method should not be called directly; rather the getSchedule() method will call it when the schedule is invalid. It is not synchronized on the workspace.- Overrides:
_getSchedule
in classScheduler
- Returns:
- A schedule.
- Throws:
NotSchedulableException
- If the model is not schedulable.- See Also:
CompositeEntity.deepEntityList()
-
-