public class EDF extends Director
A hard real-time system consists of concurrently executing actors that release jobs. Jobs have deadlines and represent demands for execution by the processing elements that comprise the platform that the system is running on.
A scheduling policy determines the way that the available jobs are allocated on the processing elements. The EDF policy on a uniprocessor platform dictates that the job that has the smallest deadline should be given priority over the other jobs. Ties are broken arbitrarily.
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected Job |
_currentJob
The job that is currently executing on the processor.
|
protected Time |
_timeCurrentJobStarted
The time that the current job started executing.
|
Parameter |
createPlot
Boolean parameter that controls whether a plot of the execution is displayed.
|
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
EDF(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addSchedulableTask(Task task)
Add a task to the set of schedulable tasks, i.e.
|
void |
fire()
Fire the schedulable tasks contained in the real-time system.
|
void |
initialize()
Check that contained actors are periodic tasks or multiframe tasks and create a task plot
to display the system's execution.
|
boolean |
postfire()
Check if a deadline has been missed, if the current job finished its execution,
choose the smallest deadline job, and execute it until a new job is to be released,
or the current job finishes executing.
|
void |
preinitialize()
Clear current job, released jobs, and schedulable tasks.
|
void |
releaseJob(Job job)
Release a job.
|
void |
wrapup()
Invoke the wrapup() method of all the actors contained in the
director's container.
|
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, _transferOutputs, addInitializable, attributeChanged, clone, createSchedule, defaultDependency, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, invalidateSchedule, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, mutexLockObject, newReceiver, notifyTokenSentToCommunicationAspect, prefire, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suggestedModalModelDirectors, supportMultirateFiring, suspend, terminate, transferInputs, transferOutputs, transferOutputs
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, 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
public Parameter createPlot
protected Job _currentJob
protected Time _timeCurrentJobStarted
public EDF(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 container not a
CompositeActor and the name collides with an entity in the container.public void addSchedulableTask(Task task)
task
- The task to add to the schedulable tasks.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class Director
IllegalActionException
- If the fire of one of the tasks contained by the platform
throws it.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class Director
IllegalActionException
- If the composite actor contains actors that are not
periodic tasks or multiframe tasks, if the top level effigy cannot be found, or if
getting the model stop time throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class Director
IllegalActionException
- If the Time constructor, getting the next release times,
or setting model throw it.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 void releaseJob(Job job)
job
- The job to release.public void wrapup() throws IllegalActionException
Director
This method should be invoked once per execution. None of the other action methods should be invoked after it in the execution. This method is not synchronized on the workspace, so the caller should be.
wrapup
in interface Initializable
wrapup
in class Director
IllegalActionException
- If the wrapup() method of
one of the associated actors throws it.