public class TCSDirector extends DEDirector
NamedObj.ContainedObjectsIterator
_actorsFinished, _actorsInExecution, _disabledActors, _eventQueue, _eventQueueLock, _isInitializing, _microstep, _noMoreActorsToFire, _stopFireRequested, binCountFactor, enforceMicrostepSemantics, isCQAdaptive, minBinCount, stopWhenQueueIsEmpty, synchronizeToRealTime
_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 |
---|
TCSDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the default workspace with an empty string
as its name.
|
Modifier and Type | Method and Description |
---|---|
ArrayToken |
getColor(java.lang.String symbol)
Return the color of the line.
|
void |
handleInitializedSourceStation(AbstractSourceStation abstractSourceStation)
Handle initializing of a SourceStation.
|
void |
handleInitializedStation(AbstractStation station)
Put an entry into _brokenStations for the initialized station.
|
void |
handleInitializedTrack(AbstractTrack track)
Put an entry into _brokenTracks for the initialized track.
|
double |
handleRejectionWithDelay(AbstractTrack track)
Return an additional delay for a track to keep a train in transit.
|
double |
handleRejectionWithDelayStation(AbstractStation station)
Return an additional delay for a Station to keep a Train in transit.
|
void |
handleStationAttributeChanged(AbstractStation station)
Update _brokenStations array because of a change in condition of a station.
|
void |
handleTrackAttributeChanged(AbstractTrack track)
Update the _brokenTracks array because of a change in condition of a track.
|
ArrayToken |
handleTrainColor(int id)
Return color of the train.
|
void |
initialize()
Initialize all the contained actors by invoke the initialize() method
of the super class.
|
void |
lineColoring()
Set color of the lines in Metro.
|
double |
movingTimeOfTrain(Token inTransit,
Token id)
Return moving time of a train in a track or station.
|
Receiver |
newReceiver()
Return a new receiver of the type TCSReceiver.
|
java.util.Map<java.lang.String,Token> |
routing(ArrayToken lines,
Token token)
Routing a train in a station with more than one output channel
which is in the junction and by using the moving map of the
train.
|
_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, invalidateSchedule, mutexLockObject, postfire, prefire, preinitialize, removeDebugListener, resumeActor, setIndex, stop, stopFire, suggestedModalModelDirectors, transferInputs, wrapup
_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
_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, 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
public TCSDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The containername
- The name of the directorNameDuplicationException
- If construction of Time objects fails.IllegalActionException
- If construction of Time objects fails.public Receiver newReceiver()
newReceiver
in class DEDirector
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class DEDirector
IllegalActionException
- If the initialize() method of
the super class throws it.public ArrayToken getColor(java.lang.String symbol) throws IllegalActionException
symbol
- symbol of the line.IllegalActionException
- If thrown while coloring the lines.public double handleRejectionWithDelay(AbstractTrack track) throws IllegalActionException
track
- The trackIllegalActionException
- Not thrown in this base class.public double handleRejectionWithDelayStation(AbstractStation station) throws IllegalActionException
station
- The stationIllegalActionException
- Not thrown in this base class.public void handleInitializedTrack(AbstractTrack track) throws IllegalActionException
track
- The trackIllegalActionException
- If thrown while putting the entry into _brokenTracks.public void handleInitializedStation(AbstractStation station) throws IllegalActionException
station
- The stationIllegalActionException
- If the entry cannot be put in to _brokenStationspublic void handleTrackAttributeChanged(AbstractTrack track) throws IllegalActionException
track
- The trackIllegalActionException
- If the track id is invalid or
the entry for the track has not been set in the array of
broken tracks.public void handleStationAttributeChanged(AbstractStation station) throws IllegalActionException
station
- The stationIllegalActionException
- If the station id is invalid or
if the entry for the station has not been set in the array of
broken stations.public void handleInitializedSourceStation(AbstractSourceStation abstractSourceStation) throws IllegalActionException
abstractSourceStation
- The Abstract Source stateIllegalActionException
- If the line symbol cannot be obtained or if the stationID is -1.public ArrayToken handleTrainColor(int id) throws IllegalActionException
id
- Id of the train.IllegalActionException
- If thrown while creating an ArrayToken
from the color specification.public void lineColoring() throws IllegalActionException
IllegalActionException
- If there is a problem
adding the lines to the set of line colors.public double movingTimeOfTrain(Token inTransit, Token id)
inTransit
- inTransit is the moving train.id
- Id is the id of the track or station.public java.util.Map<java.lang.String,Token> routing(ArrayToken lines, Token token) throws IllegalActionException
lines
- lines show the stations which are neighbour of the
current station, an array in form of "symbolId".token
- token shows the train.IllegalActionException