public class FCFS extends PHDAlgorithmImpl implements APISignaller
Constructor and Description |
---|
FCFS() |
Modifier and Type | Method and Description |
---|---|
void |
initialise(BraveSignallerContext context,
java.lang.String simId,
java.lang.String scenarioId,
java.util.List<java.lang.String> tdSections,
java.util.List<java.lang.String> signals,
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> routeDescriptions,
java.util.HashMap<java.lang.String,java.lang.String> trainTypes)
Initialise the junction, route descriptions and scenario.
|
void |
notifyRouteInfo(java.lang.String serviceName,
java.util.HashMap<java.lang.String,java.lang.String> signalRouteMap,
java.util.HashMap<java.lang.String,java.lang.Double> tdSectionDistances,
java.util.HashMap<java.lang.String,java.lang.Double> signalDistances,
java.util.HashMap<java.lang.Integer,java.lang.Double> stopTimes,
java.util.HashMap<java.lang.Double,java.lang.String> stopNames,
java.util.ArrayList<SpeedLimit> speedLimits,
java.util.ArrayList<Gradient> gradients)
Notifies route info.
|
void |
notifyTDSectionOccupation(java.lang.String tdSection,
java.lang.String occupyingTrain)
Response to the events that we registered for in initialise.
|
void |
notifyTrainServices(java.lang.String trainName,
java.lang.String serviceName)
Notify that the train has started to operate the specified service
|
void |
update(double elapsedTime,
java.util.Date simTime)
Update method called once per time step
|
notifyArrival, notifyTrain
initialise
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyArrival, notifyTrain
public void initialise(BraveSignallerContext context, java.lang.String simId, java.lang.String scenarioId, java.util.List<java.lang.String> tdSections, java.util.List<java.lang.String> signals, java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> routeDescriptions, java.util.HashMap<java.lang.String,java.lang.String> trainTypes)
PHDAlgorithmImpl
initialise
in interface APISignaller
initialise
in class PHDAlgorithmImpl
tdSections
- TDSections in this junctionsignals
- Signals in this junctionrouteDescriptions
- HashMap of RouteName and ArrayList of public void notifyTDSectionOccupation(java.lang.String tdSection, java.lang.String occupyingTrain)
notifyTDSectionOccupation
in interface APISignaller
notifyTDSectionOccupation
in class PHDAlgorithmImpl
public void notifyTrainServices(java.lang.String trainName, java.lang.String serviceName)
APISignaller
notifyTrainServices
in interface APISignaller
notifyTrainServices
in class PHDAlgorithmImpl
public void notifyRouteInfo(java.lang.String serviceName, java.util.HashMap<java.lang.String,java.lang.String> signalRouteMap, java.util.HashMap<java.lang.String,java.lang.Double> tdSectionDistances, java.util.HashMap<java.lang.String,java.lang.Double> signalDistances, java.util.HashMap<java.lang.Integer,java.lang.Double> stopTimes, java.util.HashMap<java.lang.Double,java.lang.String> stopNames, java.util.ArrayList<SpeedLimit> speedLimits, java.util.ArrayList<Gradient> gradients)
APISignaller
notifyRouteInfo
in interface APISignaller
notifyRouteInfo
in class PHDAlgorithmImpl
serviceName
- The name of the trainsignalRouteMap
- A signal and the corresponding route the train requires.tdSectionDistances
- A list of TDSections on the train's journey, with distances along the journey.signalDistances
- A list of Signals on the train's journey, with distances along the journey.stopNames
- A list of stop IDs indexed by distance.public void update(double elapsedTime, java.util.Date simTime)
APISignaller
update
in interface APISignaller
update
in class PHDAlgorithmImpl