public class SingleTrainSimulator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
del_S |
Constructor and Description |
---|
SingleTrainSimulator(java.lang.String trainId,
STSVehicle vehicle,
double startSpeed,
double endSpeed,
java.util.HashMap<java.lang.Double,java.lang.Double> signalClearanceTimes,
java.util.HashMap<java.lang.Double,java.lang.Double> dwellTimes)
Constructor for STS.
|
Modifier and Type | Method and Description |
---|---|
double |
brake(double vel,
double max_accel,
double Power,
double Mass,
double Coasting,
double Coasting_vel) |
void |
displayGraphs(boolean shutdownOnClose)
Display STS graphs in a simular format to the Matlab STS.
|
int[] |
getDistances() |
double |
getTimeForDistance(double distance)
Gets the time for the specified distance in the last calculation.
|
double[] |
getVel() |
static void |
main(java.lang.String[] args)
Test method for STS.
|
static double[] |
read1DArrayFile(java.lang.String fileName)
Reads a list of number is a text file and returns a double array.
|
static double[][] |
read2DArrayFile(java.lang.String fileName)
Reads a comma separated list of numbers in a file and returns a 2D double array.
|
double |
run(java.util.Date tempSimTime,
boolean drawGraphs)
Run the STS process.
|
void |
setRoute(double[][] gradient,
double[][] vel_profile,
double[] station_info,
double[] terminal)
Set route information in arrays.
|
public SingleTrainSimulator(java.lang.String trainId, STSVehicle vehicle, double startSpeed, double endSpeed, java.util.HashMap<java.lang.Double,java.lang.Double> signalClearanceTimes, java.util.HashMap<java.lang.Double,java.lang.Double> dwellTimes)
trainId
- vehicle
- startSpeed
- endSpeed
- signalClearanceTimes
- dwellTimes
- public void setRoute(double[][] gradient, double[][] vel_profile, double[] station_info, double[] terminal)
gradient
- vel_profile
- station_info
- terminal
- public double run(java.util.Date tempSimTime, boolean drawGraphs)
tempSimTime
- drawGraphs
- public double getTimeForDistance(double distance)
distance
- public void displayGraphs(boolean shutdownOnClose)
shutdownOnClose
- public static void main(java.lang.String[] args)
args
- public static double[] read1DArrayFile(java.lang.String fileName)
fileName
- public static double[][] read2DArrayFile(java.lang.String fileName)
fileName
- public double brake(double vel, double max_accel, double Power, double Mass, double Coasting, double Coasting_vel)
public double[] getVel()
public int[] getDistances()