public class Link extends TrackSegment
| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList<java.lang.Integer> |
crossoverIds |
int |
nextBlockNo
nextBlockNo : details about the next block number
|
int |
priority
priority : details about the priority of the block
|
TinyBlockList |
tinyBlockArray |
endMilePost, maximumPossibleSpeed, startMilePostBLOCK_ENTITY, LINK_ENTITY, LOOP_ENTITY| Constructor and Description |
|---|
Link() |
Link(Block _previousBlock,
Block _nextBlock) |
Link(Block blk,
double length) |
Link(Block blk,
double length,
int priority) |
Link(int no,
double length) |
Link(int nextBlockNo,
double relativePreviousBlockMilePost,
double relativeNextBlockMilePost,
double length,
int priority,
double maximumSpeed,
Block previousBlock) |
| Modifier and Type | Method and Description |
|---|---|
void |
convert(int linkDirection,
SimulationInstance simulationInstance) |
int |
getCrossover() |
java.util.ArrayList<Block> |
getCrossovers() |
java.lang.String |
getCrossoverString() |
double |
getEndMilePost() |
double |
getLength() |
Block |
getNextBlock() |
int |
getNextBlockNo() |
double |
getNextBlockRelativeMilePost() |
Block |
getPreviousBlock() |
int |
getPreviousBlockNo() |
double |
getPreviousBlockRelativeMilePost() |
int |
getPriority() |
double |
getStartMilePost() |
boolean |
hasError() |
void |
init() |
boolean |
isPriorityOneLink() |
void |
reserve(Train train,
double startTime,
double interBlockTime) |
void |
setCrossover(int crossover) |
void |
setCrossovers(java.util.ArrayList<Block> crossovers) |
void |
setLength(double length) |
void |
setNextBlock(Block nextBlock) |
void |
setNextBlockNo(int nextBlockNo) |
void |
setNextBlockRelativeMilePost(double nextBlockRelativeMilePost) |
void |
setPreviousBlock(Block previousBlock) |
void |
setPreviousBlockRelativeMilePost(double previousBlockRelativeMilePost) |
void |
setPriority(int priority) |
double |
whenFree(double startTime,
double endTime)
This will check if all the crossovers are free during the specified
interval.
|
getDirection, getMaximumPossibleSpeed, getOccupanciesToDisplay, getOccupy, getTinyBlockList, isFree, isFree, setDirection, setEndMilePost, setMaximumPossibleSpeed, setOccupied, setOccupied, setOccupy, setStartMilePost, setTinyBlockListgetEntityType, isBlock, isLink, isLoop, setEntityTypepublic int nextBlockNo
public int priority
public TinyBlockList tinyBlockArray
public java.util.ArrayList<java.lang.Integer> crossoverIds
public Link()
public Link(int no,
double length)
no - length - in (unit ?)public Link(int nextBlockNo,
double relativePreviousBlockMilePost,
double relativeNextBlockMilePost,
double length,
int priority,
double maximumSpeed,
Block previousBlock)
no - : block detailslength2 - : length in (unit ?)length - : length in (unit ?)priority - block - public Link(Block blk, double length, int priority)
length - stores length of the blockpriority - stores details about the blockpublic Link(Block blk, double length)
length - stores the length of the blockpublic void setCrossover(int crossover)
public int getCrossover()
public java.lang.String getCrossoverString()
public void init()
public double whenFree(double startTime,
double endTime)
startTime - : stores the start timeinterBlockTime - : stores the block time intervalpublic void reserve(Train train, double startTime, double interBlockTime)
trainNo - : stores train no.startTime - : stores the time of startinterBlockTime - :public void convert(int linkDirection,
SimulationInstance simulationInstance)
linkDirection - public boolean isPriorityOneLink()
public java.util.ArrayList<Block> getCrossovers()
public void setCrossovers(java.util.ArrayList<Block> crossovers)
public int getPriority()
public void setPriority(int priority)
public double getLength()
getLength in class TrackSegmentpublic void setLength(double length)
setLength in class TrackSegmentpublic Block getNextBlock()
public void setNextBlock(Block nextBlock)
public int getNextBlockNo()
public void setNextBlockNo(int nextBlockNo)
public int getPreviousBlockNo()
public Block getPreviousBlock()
public void setPreviousBlock(Block previousBlock)
public double getPreviousBlockRelativeMilePost()
public void setPreviousBlockRelativeMilePost(double previousBlockRelativeMilePost)
public double getNextBlockRelativeMilePost()
public void setNextBlockRelativeMilePost(double nextBlockRelativeMilePost)
public double getStartMilePost()
getStartMilePost in class TrackSegmentpublic double getEndMilePost()
getEndMilePost in class TrackSegment