Class Trajectory


  • public class Trajectory
    extends Object
    It contains one or multiple Segment object(s) to simulate the journey of a token on a graph with the time in the abscissa and the distance in ordinate

    Trajectory class diagram

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Float absciss​(float y)
      return the absciss of the y value on the trajectory
      void addSegment​(Segment segment)
      add the segment parameter to the segments of the trajectory if the segment parameter has a previous link segment : add it to its next segment
      void followFrom​(float x, Trajectory trajectory)
      after a truncate is done, the trajectory can be updated to follow a trajectory set in parameter from a x abscissa value also set in parameter
      Trajectory getBlockTraj()  
      float getHeadway()  
      ArrayList<Segment> getSegments()  
      Float isBlockedBy​(Trajectory trajectoryParam)
      return the abscissa of the point where the current Trajectory is blocked by the one set in parameter and its headway else, if it is not blocked : return null
      boolean isSinglePoint()  
      void leftShift​(float delta)
      advance the time to the delta value as specified in parameter -it performs a shift to the segments on the left by decreasing the abscissa values -it deletes the segments with P1.x < 0 -it truncate the segments with P0.x < 0 return true if the trajectory has no more segments
      Float ordinate​(float x)
      return the ordinate of the x abscissa value on the trajectory
      void recover()
      after a trajectory has been followed to preserve headways the segments of this trajectory can get to the origin segments
      void setBlockTraj​(Trajectory blockTraj)  
      void setHeadway​(float value)  
      void truncateFrom​(float x)
      truncate the trajectory from the x parameter value truncate the segment in which x is in its interval remove the segments which begin after x
      Trajectory upwardShift()
      create a new Trajectory object based on the current Trajectory with new values of ordinate increased by the headway value and a last segment with an ordinate of headway where the current trajectory ordinate is 0
    • Constructor Detail

      • Trajectory

        public Trajectory()
    • Method Detail

      • addSegment

        public void addSegment​(Segment segment)
        add the segment parameter to the segments of the trajectory if the segment parameter has a previous link segment : add it to its next segment
      • getHeadway

        public float getHeadway()
      • setHeadway

        public void setHeadway​(float value)
      • ordinate

        public Float ordinate​(float x)
        return the ordinate of the x abscissa value on the trajectory
      • absciss

        public Float absciss​(float y)
        return the absciss of the y value on the trajectory
      • upwardShift

        public Trajectory upwardShift()
        create a new Trajectory object based on the current Trajectory with new values of ordinate increased by the headway value and a last segment with an ordinate of headway where the current trajectory ordinate is 0
      • setBlockTraj

        public void setBlockTraj​(Trajectory blockTraj)
      • isBlockedBy

        public Float isBlockedBy​(Trajectory trajectoryParam)
        return the abscissa of the point where the current Trajectory is blocked by the one set in parameter and its headway else, if it is not blocked : return null
      • leftShift

        public void leftShift​(float delta)
        advance the time to the delta value as specified in parameter -it performs a shift to the segments on the left by decreasing the abscissa values -it deletes the segments with P1.x < 0 -it truncate the segments with P0.x < 0 return true if the trajectory has no more segments
      • truncateFrom

        public void truncateFrom​(float x)
        truncate the trajectory from the x parameter value truncate the segment in which x is in its interval remove the segments which begin after x
      • followFrom

        public void followFrom​(float x,
                               Trajectory trajectory)
        after a truncate is done, the trajectory can be updated to follow a trajectory set in parameter from a x abscissa value also set in parameter
      • recover

        public void recover()
        after a trajectory has been followed to preserve headways the segments of this trajectory can get to the origin segments
      • isSinglePoint

        public boolean isSinglePoint()