Class Step

java.lang.Object
casa.lepton.walk.Step

public class Step extends Object
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

    Constructors
    Constructor
    Description
    Step(casa.util.geom.CoordCar dep, casa.util.geom.CoordCar arr, long timeOfDep, double speed, long pauseDuration)
     
    Step(casa.util.geom.CoordCar dep, casa.util.geom.CoordCar arr, long timeOfDep, long flightDuration, long pauseDuration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    casa.util.geom.CoordCar
    Returns the point of arrival of this Step
    casa.util.geom.CoordCar
    Returns the point of departure of this Step
    double
    Returns the distance covered by this Step (distance between point of departure and point of arrival, in meters)
    long
    Returns the duration of the flight in this Step (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
    main(String[] args)
     
    long
    Returns the duration of the pause in this Step (in ms)
    double
    Returns the flight speed during this Step (in m/s)
    long
    Returns the duration of this Step (flight duration + pause duration, in ms)
    long
    Returns the time of arrival of this Step (EPOCH time in ms)
    long
    Returns the time of completion of this Step (time of arrival + pause duration) (EPOCH time in ms)
    long
    Returns the time of departure of this Step (EPOCH time in ms)
    Returns a representation of this step as a String

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 this Step
      Returns:
      the point of departure of this Step
    • timeOfDeparture

      public long timeOfDeparture()
      Returns the time of departure of this Step (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 this Step
      Returns:
      the point of arrival of this Step
    • timeOfArrival

      public long timeOfArrival()
      Returns the time of arrival of this Step (EPOCH time in ms)
      Returns:
      the time of arrival of this Step
    • timeOfCompletion

      public long timeOfCompletion()
      Returns the time of completion of this Step (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 this Step (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 this Step (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 this Step (in ms)
      Returns:
      the duration of the pause in this Step
    • stepDuration

      public long stepDuration()
      Returns the duration of this Step (flight duration + pause duration, in ms)
      Returns:
      the duration of this Step
    • speed

      public double speed()
      Returns the flight speed during this Step (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

      public String toString()
      Returns a representation of this step as a String
      Overrides:
      toString in class Object
      Returns:
      a representation of this step as a String
    • main

      public static void main(String[] args)