public class BlockDirectionInInterval
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<BlockInterval> |
blockIntervalArray
timeOfDirectionSwitching list of time instances at which the direction of
the block is changed.
|
Constructor and Description |
---|
BlockDirectionInInterval() |
Modifier and Type | Method and Description |
---|---|
static void |
addBlockDirectionInIntervalToBlock(int blockNumber,
java.lang.String startTimeListString,
java.lang.String endTimeListString,
java.lang.String directionString,
SimulationInstance simulationInstance)
Add the list of timeChanges of direction switching to the block
|
BlockInterval |
getBlockIntervalFromTime(double time) |
double |
getEarliestArrivalTimeFromBlockInterval(double arrivalTime,
int direction) |
boolean |
isDirectionOk(int trainDirection,
double arrivalTime)
Check if train direction is same as block direction at a given time
|
static void |
readBlockDirectionInIntervalFile(SimulationInstance simulationInstance)
For reading the BlockDirectionInInterval file
|
public java.util.ArrayList<BlockInterval> blockIntervalArray
public static void readBlockDirectionInIntervalFile(SimulationInstance simulationInstance) throws java.io.IOException
java.io.IOException
public static void addBlockDirectionInIntervalToBlock(int blockNumber, java.lang.String startTimeListString, java.lang.String endTimeListString, java.lang.String directionString, SimulationInstance simulationInstance)
blockNumber
- : stores the block numberstartTimeListString
- : stores the start timeendTimeListString
- : stores the end timedirectionString
- : stores the directionpublic boolean isDirectionOk(int trainDirection, double arrivalTime)
trainDirection
- : stores the train directionarrivalTime
- : stores the arrival time (unit ?)public BlockInterval getBlockIntervalFromTime(double time)
time
- stores time in(unit ?)public double getEarliestArrivalTimeFromBlockInterval(double arrivalTime, int direction)
arrivalTime
- stores time in(unit ?)direction
-