public abstract class PHDAlgorithmImpl extends Analysis implements APISignaller
Constructor and Description |
---|
PHDAlgorithmImpl() |
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 |
notifyArrival(java.lang.String arrivingTrain,
java.util.Date time,
java.lang.String stopId)
Debug analysis of arrivals.
|
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 |
notifyTrain(java.lang.String trainId,
double distance,
double speed)
Notify plugin of the exact location and speed of a train.
|
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
|
initialise
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)
initialise
in interface APISignaller
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
public void notifyTrainServices(java.lang.String trainName, java.lang.String serviceName)
APISignaller
notifyTrainServices
in interface APISignaller
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
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 notifyTrain(java.lang.String trainId, double distance, double speed)
APISignaller
notifyTrain
in interface APISignaller
public void update(double elapsedTime, java.util.Date simTime)
APISignaller
update
in interface APISignaller
public void notifyArrival(java.lang.String arrivingTrain, java.util.Date time, java.lang.String stopId)
notifyArrival
in interface APISignaller
notifyArrival
in class Analysis