Package ptolemy.domains.atc.lib
Class Track
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Rejecting
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class Track extends TrackWriter implements Rejecting
A model of a track in air traffic control systems. This track can have no more than one aircraft in transit. If there is one in transit, then it rejects all inputs.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Maryam Bagheri
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description TypedIOPort
eastOutput
The east output.TypedIOPort
input
The input, which is a multiport.Parameter
neighbors
The neighbors.TypedIOPort
northOutput
The north output.TypedIOPort
southOutput
The south output.Parameter
stormy
A boolean indicating if it is stormy.Parameter
trackId
The trackId.-
Fields inherited from class ptolemy.domains.atc.lib.TrackWriter
_flushValue, _writer, fileName
-
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 Track(CompositeEntity container, java.lang.String name)
Construct an actor with the given container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_setIcon(int id)
Set the visual indication of the icon for the specified ID.void
attributeChanged(Attribute attribute)
If the specified attribute is stormy and there is an open file being written, then close that file.void
declareDelayDependency()
Set the dependency between all output ports and all input ports of this actor.void
fire()
Do nothing.void
initialize()
Initialize this actor.boolean
reject(Token token, IOPort port)
Return true if the token cannot be accepted at the specified port.-
Methods inherited from class ptolemy.domains.atc.lib.TrackWriter
_writeToken, _writingToFile, clone, preinitialize, 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, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, 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, removeInitializable
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Field Detail
-
input
public TypedIOPort input
The input, which is a multiport.
-
northOutput
public TypedIOPort northOutput
The north output.
-
eastOutput
public TypedIOPort eastOutput
The east output.
-
southOutput
public TypedIOPort southOutput
The south output.
-
trackId
public Parameter trackId
The trackId. The initial default is an integer with a value of -1.
-
neighbors
public Parameter neighbors
The neighbors. The initial value is an array with values {-1, -1, -1}.
-
stormy
public Parameter stormy
A boolean indicating if it is stormy.
-
-
Constructor Detail
-
Track
public Track(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an actor with the given container and name.- Parameters:
container
- The container.name
- The name of this actor.- Throws:
IllegalActionException
- If the actor cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
-
Method Detail
-
reject
public boolean reject(Token token, IOPort port)
Return true if the token cannot be accepted at the specified port.
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
If the specified attribute is stormy and there is an open file being written, then close that file. The new file will be opened or created when it is next written to.- Overrides:
attributeChanged
in classTrackWriter
- Parameters:
attribute
- The attribute that has changed.- Throws:
IllegalActionException
- If the specified attribute is fileName and the previously opened file cannot be closed.
-
declareDelayDependency
public void declareDelayDependency() throws IllegalActionException
Description copied from class:AtomicActor
Set the dependency between all output ports and all input ports of this actor. By default, each output port is assumed to have a dependency on all input ports. Since this is the assumed behavior, this method does nothing by default. However, for subclasses such asTimeDelay
, where output ports depend on input ports with a time delay, this method should be overridden. Protected method _declareDelayDependency() should be used to declare dependency between input and output ports for this actor.- Overrides:
declareDelayDependency
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- Not thrown in this base class, derived classes should throw this exception if the delay dependency cannot be computed.- See Also:
AtomicActor.getCausalityInterface()
,AtomicActor._declareDelayDependency(IOPort, IOPort, double)
-
fire
public void fire() throws IllegalActionException
Description copied from class:AtomicActor
Do nothing. Derived classes override this method to define their primary run-time action.- Specified by:
fire
in interfaceExecutable
- Overrides:
fire
in classAtomicActor<TypedIOPort>
- Throws:
IllegalActionException
- Not thrown in this base class.
-
initialize
public void initialize() throws IllegalActionException
Initialize this actor. Derived classes override this method to perform actions that should occur once at the beginning of an execution, but after type resolution. Derived classes can produce output data and schedule events.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classTrackWriter
- Throws:
IllegalActionException
- If a derived class throws it.
-
_setIcon
protected void _setIcon(int id) throws IllegalActionException
Set the visual indication of the icon for the specified ID.- Parameters:
id
- The aircraft ID or -1 to indicate no aircraft.- Throws:
IllegalActionException
-
-