Modifier and Type | Field and Description |
---|---|
double |
endMilePost |
Station |
nextStation
prevStn will store the next station in the down(1) direction
|
Station |
previousStation
previousStation
|
double |
startMilePost |
java.lang.String |
stationName |
double |
stationVelocity |
BLOCK_ENTITY, LINK_ENTITY, LOOP_ENTITY
Constructor and Description |
---|
Station() |
Station(double a,
double b,
double c,
java.lang.String str) |
Station(java.lang.String stationName,
java.lang.String stationCode,
double startMilePost,
double endMilePost,
double stationVelocity)
stationName
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Station a,
Station b)
(non-Javadoc)
|
double |
getDepartTime(int trainNo,
int dir)
Get the departing time of the train
|
double |
getEndMilePost() |
java.lang.String |
getInfoString() |
Loop |
getMainLoop(int direction)
Get the main loop of the station.
|
double |
getStartMilePost() |
java.lang.String |
getStationCode() |
static Station |
getStationFromFile(java.io.StreamTokenizer stationTokenizer,
java.lang.String stationCode) |
java.lang.String |
getStationName() |
double |
getStationVelocity() |
boolean |
hasError() |
Station |
nextStation(int dir)
This will return the next station in the direction given.
|
Station |
prevStation(int dir)
This will return the previous station in the direction given.
|
void |
printAttributes() |
void |
setEndMilePost(double endMilePost) |
void |
setStartMilePost(double startMilePost) |
void |
setStationCode(java.lang.String stationCode) |
void |
setStationName(java.lang.String stationName) |
void |
setStationVelocity(double stationVelocity) |
int |
simulateTrain(Train currTrain,
java.lang.String simulationType,
SimulationInstance simulationInstance)
Station: int simulateTrain(Train currTrain) 1) Consider the starting loop.
|
void |
write(java.io.BufferedWriter stationWriter) |
getEntityType, isBlock, isLink, isLoop, setEntityType
public double startMilePost
public double endMilePost
public java.lang.String stationName
public double stationVelocity
public Station previousStation
public Station nextStation
public Station(java.lang.String stationName, java.lang.String stationCode, double startMilePost, double endMilePost, double stationVelocity)
public Station()
public Station(double a, double b, double c, java.lang.String str)
a
- b
- c
- str
- public void printAttributes()
public java.lang.String getInfoString()
public void setStartMilePost(double startMilePost)
public double getStartMilePost()
public void setEndMilePost(double endMilePost)
public double getEndMilePost()
public void setStationName(java.lang.String stationName)
public java.lang.String getStationName()
public void setStationCode(java.lang.String stationCode)
public java.lang.String getStationCode()
public void write(java.io.BufferedWriter stationWriter) throws java.io.IOException
java.io.IOException
public void setStationVelocity(double stationVelocity)
public double getStationVelocity()
public static Station getStationFromFile(java.io.StreamTokenizer stationTokenizer, java.lang.String stationCode) throws java.io.IOException
java.io.IOException
public Station nextStation(int dir)
dir
- public Station prevStation(int dir)
dir
- directionpublic Loop getMainLoop(int direction)
direction
- public double getDepartTime(int trainNo, int dir)
trainNo
- train numberdir
- directionpublic int simulateTrain(Train currTrain, java.lang.String simulationType, SimulationInstance simulationInstance)
currTrain
- simulationType
- public int compare(Station a, Station b)
compare
in interface java.util.Comparator<Station>
Comparator.compare(java.lang.Object, java.lang.Object)