Package ptolemy.actor.lib.aspect
Class EDFScheduler
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,ActorExecutionAspect
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Decorator
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class EDFScheduler extends FixedPriorityScheduler
This is an earliest deadline first scheduler.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Patricia Derler
- Pt.AcceptedRating:
- Red (derler)
- Pt.ProposedRating:
- Red (derler)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.lib.aspect.FixedPriorityScheduler
_currentlyExecuting, LOWEST_PRIORITY, preemptive
-
Fields inherited from class ptolemy.actor.lib.aspect.AtomicExecutionAspect
_actors, _executionAspectListeners, _lastActorFinished, _lastActorThatFinished, _lastTimeScheduled, _remainingTimes
-
Fields inherited from class ptolemy.actor.TypedAtomicActor
_typesValid
-
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
-
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
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description EDFScheduler(CompositeEntity container, java.lang.String name)
Create a new actor in the specified container with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
_getPriority(NamedObj actor)
Get the deadline of the actor and return it as the priority.DecoratorAttributes
createDecoratorAttributes(NamedObj target)
Return the decorated attributes for the target NamedObj.void
initialize()
Initialize local variables.Time
schedule(Time environmentTime)
Perform rescheduling actions when no new actor requests to be scheduled.Time
schedule(NamedObj actor, Time currentPlatformTime, Time deadline, Time executionTime)
Schedule a new actor for execution and return the next time this scheduler has to perform a reschedule.-
Methods inherited from class ptolemy.actor.lib.aspect.FixedPriorityScheduler
attributeChanged, clone
-
Methods inherited from class ptolemy.actor.lib.aspect.AtomicExecutionAspect
_getDeadline, addExecutingListener, decoratedObjects, fire, getExecutionTime, getRemainingTime, getTime, initializeDecoratedActors, isGlobalDecorator, isWaitingForResource, lastActorFinished, lastScheduledActorFinished, notifyExecutionListeners, removeExecutionListener, setContainer, wrapup
-
Methods inherited from class ptolemy.actor.TypedAtomicActor
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, stop, stopFire, terminate
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
EDFScheduler
public EDFScheduler(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create a new actor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.- Parameters:
container
- The container.name
- The name of this actor within the container.- Throws:
IllegalActionException
- If this actor cannot be contained by the proposed container (see the setContainer() method).NameDuplicationException
- If the name coincides with an entity already in the container.
-
-
Method Detail
-
createDecoratorAttributes
public DecoratorAttributes createDecoratorAttributes(NamedObj target)
Return the decorated attributes for the target NamedObj. If the specified target is not an Actor, return null.- Specified by:
createDecoratorAttributes
in interfaceDecorator
- Overrides:
createDecoratorAttributes
in classFixedPriorityScheduler
- Parameters:
target
- The NamedObj that will be decorated.- Returns:
- The decorated attributes for the target NamedObj, or null if the specified target is not an Actor.
-
initialize
public void initialize() throws IllegalActionException
Initialize local variables.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classFixedPriorityScheduler
- Throws:
IllegalActionException
- Thrown in super class.
-
schedule
public Time schedule(NamedObj actor, Time currentPlatformTime, Time deadline, Time executionTime) throws IllegalActionException
Schedule a new actor for execution and return the next time this scheduler has to perform a reschedule.- Specified by:
schedule
in interfaceActorExecutionAspect
- Overrides:
schedule
in classFixedPriorityScheduler
- Parameters:
actor
- The actor to be scheduled.currentPlatformTime
- The current platform time.deadline
- The event deadline.executionTime
- The execution time of the actor.- Returns:
- Relative time when this Scheduler has to be executed again.
- Throws:
IllegalActionException
- Thrown if actor parameters such as execution time or priority cannot be read.
-
schedule
public Time schedule(Time environmentTime) throws IllegalActionException
Perform rescheduling actions when no new actor requests to be scheduled.- Specified by:
schedule
in interfaceActorExecutionAspect
- Overrides:
schedule
in classFixedPriorityScheduler
- Parameters:
environmentTime
- The outside time.- Returns:
- Relative time when this Scheduler has to be executed again to perform rescheduling actions.
- Throws:
IllegalActionException
- Thrown in subclasses.
-
_getPriority
protected double _getPriority(NamedObj actor) throws IllegalActionException
Get the deadline of the actor and return it as the priority. The priority is treated equal to deadline in this scheduler: lower value for the priority means higher priority, lower deadline means higher priority.- Overrides:
_getPriority
in classFixedPriorityScheduler
- Parameters:
actor
- The actor.- Returns:
- The priority of the actor or, if the actor has no priority assigned, the lowest priority.
- Throws:
IllegalActionException
- Thrown if parameter cannot be read.
-
-