Package ptolemy.domains.atc.kernel
Class AbstractATCDirector
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.Director
-
- ptolemy.domains.de.kernel.DEDirector
-
- ptolemy.domains.atc.kernel.AbstractATCDirector
-
- All Implemented Interfaces:
java.lang.Cloneable
,Executable
,Initializable
,SuperdenseTimeDirector
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
ATCDirector
,ATCDirector
public abstract class AbstractATCDirector extends DEDirector
An air traffic control (ATC) Director.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Maryam Bagheri
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.domains.de.kernel.DEDirector
_actorsFinished, _actorsInExecution, _disabledActors, _eventQueue, _eventQueueLock, _isInitializing, _microstep, _noMoreActorsToFire, _stopFireRequested, binCountFactor, enforceMicrostepSemantics, isCQAdaptive, minBinCount, stopWhenQueueIsEmpty, synchronizeToRealTime
-
Fields inherited from class ptolemy.actor.Director
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
-
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 AbstractATCDirector(CompositeEntity container, java.lang.String name)
Create a new director in the specified container with the specified name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ArrayToken
handleAirplaneColor(int id)
Return airplane's color.abstract void
handleInitializedAirport(Airport airport)
Handle initializing of an airport.abstract void
handleInitializedDestination(DestinationAirport destinationAirport)
Handle initializing of a destination airport.abstract void
handleInitializedTrack(Track track)
Put an entry into _neighbors , _stormyTrack and _inTransit for the initialized track.abstract double
handleRejectionWithDelay(Track track)
Return an additional delay for a track to keep an aircraft in transit.abstract void
handleTrackAttributeChanged(Track track)
Update _stormyTracks array because of a change in condition of a track.abstract java.util.Map<java.lang.String,Token>
rerouteUnacceptedAircraft(Token aircraft)
Reroute an aircraft.abstract boolean
returnTrackStatus(Token trackId)
Return status of the track.abstract RecordToken
routing(Token aircraft, Token trackId)
Routing an aircraft based on its flight map.abstract void
setInTransitStatusOfTrack(Token trackId, boolean trackStatus)
Update inTransit status of a track.-
Methods inherited from class ptolemy.domains.de.kernel.DEDirector
_actorFired, _checkForNextEvent, _disableActor, _enqueueEvent, _enqueueTriggerEvent, _fire, _getDepthOfActor, _getDepthOfIOPort, _getNextActorToFire, _issueExecutionAspectWarning, _noActorToFire, _requestFiring, _schedule, addDebugListener, attributeChanged, cancelFireAt, cancelFireAt, clone, describePriorities, fire, fireAt, fireAt, fireAtCurrentTime, fireAtRelativeTime, getCausalityInterface, getIndex, getMicrostep, getModelNextIterationTime, getNextEventTime, getStartTime, getStopTime, initialize, invalidateSchedule, mutexLockObject, newReceiver, postfire, prefire, preinitialize, removeDebugListener, resumeActor, setIndex, stop, stopFire, suggestedModalModelDirectors, transferInputs, wrapup
-
Methods inherited from class ptolemy.actor.Director
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _transferInputs, _transferOutputs, addInitializable, createSchedule, defaultDependency, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireContainerAt, fireContainerAt, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, supportMultirateFiring, suspend, terminate, transferOutputs, transferOutputs
-
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, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, 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, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
AbstractATCDirector
public AbstractATCDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create a new director 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
-
handleRejectionWithDelay
public abstract double handleRejectionWithDelay(Track track) throws IllegalActionException
Return an additional delay for a track to keep an aircraft in transit.- Parameters:
track
- The track.- Returns:
- An additional delay, or -1.0 to indicate that a rerouting is possible.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
handleTrackAttributeChanged
public abstract void handleTrackAttributeChanged(Track track) throws IllegalActionException
Update _stormyTracks array because of a change in condition of a track.- Parameters:
track
- The track.- Throws:
IllegalActionException
- Not thrown in this base class.
-
handleInitializedTrack
public abstract void handleInitializedTrack(Track track) throws IllegalActionException
Put an entry into _neighbors , _stormyTrack and _inTransit for the initialized track.- Parameters:
track
- The track.- Throws:
IllegalActionException
- Not thrown in this base class.
-
routing
public abstract RecordToken routing(Token aircraft, Token trackId) throws IllegalActionException
Routing an aircraft based on its flight map.- Parameters:
aircraft
- (this token is a record of "aircraftId","aircraftSpeed","flightMap" and "priorTrack"and ...)trackId
- The trackid.- Returns:
- A RecordToken representing the routing.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
returnTrackStatus
public abstract boolean returnTrackStatus(Token trackId)
Return status of the track.- Parameters:
trackId
- The trackid.- Returns:
- The status of the track.
-
setInTransitStatusOfTrack
public abstract void setInTransitStatusOfTrack(Token trackId, boolean trackStatus) throws IllegalActionException
Update inTransit status of a track.- Parameters:
trackId
- The trackidtrackStatus
- The status- Throws:
IllegalActionException
- Not thrown in this base class.
-
rerouteUnacceptedAircraft
public abstract java.util.Map<java.lang.String,Token> rerouteUnacceptedAircraft(Token aircraft) throws IllegalActionException
Reroute an aircraft.- Parameters:
aircraft
- The aircraft- Returns:
- a Map of rerouted aircraft.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
handleAirplaneColor
public abstract ArrayToken handleAirplaneColor(int id) throws IllegalActionException
Return airplane's color. If the airplane has not color, set a color for that and store it.- Parameters:
id
- id of the airplane- Returns:
- The color of the airplane.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
handleInitializedAirport
public abstract void handleInitializedAirport(Airport airport) throws IllegalActionException
Handle initializing of an airport.- Parameters:
airport
- The airport- Throws:
IllegalActionException
- Not thrown in this base class.
-
handleInitializedDestination
public abstract void handleInitializedDestination(DestinationAirport destinationAirport) throws IllegalActionException
Handle initializing of a destination airport. This function stores airport id in _airportsId- Parameters:
destinationAirport
- The destination.- Throws:
IllegalActionException
- Not thrown in this base class.
-
-