Package casa.lepton.walk
Class Step
java.lang.Object
casa.lepton.walk.Step
Defines a step in a
Walk
. A step combines a flight (i.e., a move
between two points) and a pause. The flight is basically characterized by a
point and time of departure, and a point and time of arrival. The distance
between both points can be determined, as well as the duration of the flight.
The pause occurs at the point of arrival, and it is simply characterized by
its duration.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncasa.util.geom.CoordCar
arrival()
Returns the point of arrival of thisStep
casa.util.geom.CoordCar
Returns the point of departure of thisStep
double
distance()
Returns the distance covered by thisStep
(distance between point of departure and point of arrival, in meters)long
Returns the duration of the flight in thisStep
(time of arrival - time of departure, in ms)casa.util.geom.CoordCar
getPosition
(long time) Returns the position determined by this step at the specified time.boolean
isMoving
(long time) Returns true if this step defines an ongoing flight at the specified time (i.e. time in ]timeOfDeparture, timeOfArrival[), false otherwise (time expressed as EPOCH in ms)static void
long
Returns the duration of the pause in thisStep
(in ms)double
speed()
Returns the flight speed during thisStep
(in m/s)long
Returns the duration of thisStep
(flight duration + pause duration, in ms)long
Returns the time of arrival of thisStep
(EPOCH time in ms)long
Returns the time of completion of thisStep
(time of arrival + pause duration) (EPOCH time in ms)long
Returns the time of departure of thisStep
(EPOCH time in ms)toString()
Returns a representation of this step as aString
-
Constructor Details
-
Step
public Step(casa.util.geom.CoordCar dep, casa.util.geom.CoordCar arr, long timeOfDep, double speed, long pauseDuration) -
Step
public Step(casa.util.geom.CoordCar dep, casa.util.geom.CoordCar arr, long timeOfDep, long flightDuration, long pauseDuration)
-
-
Method Details
-
departure
public casa.util.geom.CoordCar departure()Returns the point of departure of thisStep
- Returns:
- the point of departure of this
Step
-
timeOfDeparture
public long timeOfDeparture()Returns the time of departure of thisStep
(EPOCH time in ms)- Returns:
- the time of departure of this
Step
-
arrival
public casa.util.geom.CoordCar arrival()Returns the point of arrival of thisStep
- Returns:
- the point of arrival of this
Step
-
timeOfArrival
public long timeOfArrival()Returns the time of arrival of thisStep
(EPOCH time in ms)- Returns:
- the time of arrival of this
Step
-
timeOfCompletion
public long timeOfCompletion()Returns the time of completion of thisStep
(time of arrival + pause duration) (EPOCH time in ms)- Returns:
- the time of completion of this
Step
-
distance
public double distance()Returns the distance covered by thisStep
(distance between point of departure and point of arrival, in meters)- Returns:
- the distance covered by this
Step
-
flightDuration
public long flightDuration()Returns the duration of the flight in thisStep
(time of arrival - time of departure, in ms)- Returns:
- the duration of the flight in this
Step
-
pauseDuration
public long pauseDuration()Returns the duration of the pause in thisStep
(in ms)- Returns:
- the duration of the pause in this
Step
-
stepDuration
public long stepDuration()Returns the duration of thisStep
(flight duration + pause duration, in ms)- Returns:
- the duration of this
Step
-
speed
public double speed()Returns the flight speed during thisStep
(in m/s)- Returns:
- the flight speed during this
Step
-
isMoving
public boolean isMoving(long time) Returns true if this step defines an ongoing flight at the specified time (i.e. time in ]timeOfDeparture, timeOfArrival[), false otherwise (time expressed as EPOCH in ms)- Returns:
- true if this step defines an ongoing flight mode at the specified time
-
getPosition
public casa.util.geom.CoordCar getPosition(long time) Returns the position determined by this step at the specified time. This position is computed based on the flight speed and on the departure and arrival positions if the specified if time in ]timeOfDeparture, timeOfArrival[. Otherwise the position is assumed to be the departure or the arrival position, depending on whether the specified time is before or after the flight. (time expressed as EPOCH in ms)- Returns:
- the position determined by this step at the specified time
-
toString
Returns a representation of this step as aString
-
main
-