TSimInformation
public class SensorEvent extends java.lang.Object implements TSimInformation
Modifier and Type | Field | Description |
---|---|---|
static int |
ACTIVE |
|
static int |
INACTIVE |
|
protected int |
status |
|
protected int |
trainId |
|
protected int |
xPos |
|
protected int |
yPos |
Constructor | Description |
---|---|
SensorEvent(int trainId,
int xPos,
int yPos,
int status) |
Creates a new SensorEvent for a specific train and sensor.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getStatus() |
Returns the status of the sensor; either ACTIVE or INACTIVE.
|
int |
getTrainId() |
Returns the id of the train affecting the sensor.
|
int |
getXpos() |
Returns the x coordinate of the affected sensor.
|
int |
getYpos() |
Returns theyx coordinate of the affected sensor.
|
java.lang.String |
toString() |
public static final int ACTIVE
public static final int INACTIVE
protected int trainId
protected int status
protected int xPos
protected int yPos
public SensorEvent(int trainId, int xPos, int yPos, int status)
trainId
- the id of the train passing the sensor.xPos
- the x coordinate of the sensor.yPos
- the y coordinate of the sensor.status
- the status of the sensor; either ACTIVE or INACTIVE/public int getXpos()
public int getYpos()
public int getStatus()
public int getTrainId()
public java.lang.String toString()
toString
in class java.lang.Object