public class Movement
extends java.lang.Object
Constructor and Description |
---|
Movement()
Constructs a Movement object with empty values.
|
Movement(Track track,
double accDuration,
double maxSpeedDuration,
double decDuration,
double initialSpeed,
double maxSpeed,
double endSpeed)
It constructs a Movement object with given speed and duration of each phases.
|
Movement(Track track,
TimeSpan accDuration,
TimeSpan maxSpeedDuration,
TimeSpan decDuration,
double initialSpeed,
double maxSpeed,
double endSpeed)
It constructs a Movement object with given speed and duration of each phases.
|
Modifier and Type | Method and Description |
---|---|
TimeSpan |
getAccDuration()
Gets the duration of the acceleration phase.
|
Length |
getCurrentMovedDistance(TimeInstant movingStartTime,
TimeInstant now)
Gets the moved distance based on the elapsed SimTime.
|
Vector3d |
getCurrentMovingDirection(TimeInstant movingStartTime,
TimeInstant now)
Gets the current moving direction on this movement based on the elapsed SimTime.
|
double[] |
getCurrentPosition(TimeInstant movingStartTime,
TimeInstant now)
Gets the current position on this movement based on elapsed SimTime.
|
TimeSpan |
getDecDuration()
Gets the duration of the deceleration phase.
|
double |
getEndSpeed()
Gets the end speed.
|
double |
getInitialSpeed()
Gets the initial speed.
|
double |
getMaxSpeed()
Gets the maximum speed.
|
TimeSpan |
getMaxSpeedDuration()
Gets the duration when the movement has the maximum speed.
|
TimeSpan |
getTotalDuration()
Gets the total duration which is the sum of all the 3 phases.
|
Track |
getTrack()
Gets the track object of this movement.
|
boolean |
isValid()
Tests if the movement is valid and fully specified.
|
void |
setAccDuration(TimeSpan accDuration)
Sets the acceleration duration
|
void |
setDecDuration(TimeSpan decDuration)
Sets the deceleration duration.
|
void |
setEndSpeed(double endSpeed)
Sets the end speed.
|
void |
setInitialSpeed(double initialSpeed)
Sets the initial speed.
|
void |
setMaxSpeed(double maxSpeed)
Sets the maximum speed.
|
void |
setMaxSpeedDuration(TimeSpan maxSpeedDuration)
Sets the duration of the maximum speed.
|
void |
setTrack(Track track)
Sets the track for the movement.
|
public Movement()
public Movement(Track track, TimeSpan accDuration, TimeSpan maxSpeedDuration, TimeSpan decDuration, double initialSpeed, double maxSpeed, double endSpeed)
track
- The track associated to this movement.accDuration
- The duration of the acceleration phase.maxSpeedDuration
- The duration of the phase when the movement has the maximum speed.decDuration
- The duration of the deceleration phase.initialSpeed
- The initial speed.maxSpeed
- The maximum speed.endSpeed
- The end speed.public Movement(Track track, double accDuration, double maxSpeedDuration, double decDuration, double initialSpeed, double maxSpeed, double endSpeed)
track
- The track associated to this movement.accDuration
- The duration of the acceleration phase.maxSpeedDuration
- The duration of the phase when the movement has the maximum speed.decDuration
- The duration of the deceleration phase.initialSpeed
- The initial speed.maxSpeed
- The maximum speed.endSpeed
- The end speed.public TimeSpan getAccDuration()
public Length getCurrentMovedDistance(TimeInstant movingStartTime, TimeInstant now)
movingStartTime
- The SimTime, when the movement has started.now
- The current SimTime.public Vector3d getCurrentMovingDirection(TimeInstant movingStartTime, TimeInstant now)
movingStartTime
- The SimTime, when the movement has started.now
- The current SimTime.public double[] getCurrentPosition(TimeInstant movingStartTime, TimeInstant now)
movingStartTime
- The SimTime, when the movement has started.now
- The current SimTime.public TimeSpan getDecDuration()
public double getEndSpeed()
public double getInitialSpeed()
public double getMaxSpeed()
public TimeSpan getMaxSpeedDuration()
public TimeSpan getTotalDuration()
public Track getTrack()
public boolean isValid()
public void setAccDuration(TimeSpan accDuration)
accDuration
- the acceleration duration to setpublic void setDecDuration(TimeSpan decDuration)
decDuration
- the deceleration duration to setpublic void setEndSpeed(double endSpeed)
endSpeed
- the end speed to setpublic void setInitialSpeed(double initialSpeed)
initialSpeed
- the initial speed to setpublic void setMaxSpeed(double maxSpeed)
maxSpeed
- the maximum speed to setpublic void setMaxSpeedDuration(TimeSpan maxSpeedDuration)
maxSpeedDuration
- the duration with the maximum speed to setpublic void setTrack(Track track)
track
- track to be set.