Class Platoon

    • Constructor Detail

      • Platoon

        public Platoon()
    • Method Detail

      • addGtu

        public void addGtu​(String id)
        Adds a GTU to the platoon. This is done by a generator listener.
        Parameters:
        id - String; GTU id
      • size

        public int size()
        Returns the size of the platoon.
        Returns:
        int; size of the platoon
      • getId

        public String getId​(int index)
        Returns the GTU id of the index
        Parameters:
        index - int; index position of gtuList
        Returns:
        String; id of gtu on index position; NULL is none?
      • addLaneChange

        public void addLaneChange​(GTU gtu)
        Add a lane change as it's finished. This will reset the lane change when all GTUs in the platoon changed lane.
        Parameters:
        gtu - GTU; gtu
      • canInitiateLaneChangeProcess

        public boolean canInitiateLaneChangeProcess()
        Returns whether the platoon is ready for a lane change (i.e. not in the process of a lane change).
        Returns:
        boolean; whether the platoon is ready for a lane change (i.e. not in the process of a lane change)
      • initiateLaneChange

        public void initiateLaneChange​(LateralDirectionality laneChangeDirection)
        Initiates a lane change.
        Parameters:
        laneChangeDirection - LateralDirectionality; direction of the lane change
      • getIndex

        public int getIndex​(String gtuId)
        Returns the index of the GTU in the platoon, with the leader 0.
        Parameters:
        gtuId - String; GTU id
        Returns:
        int; index of the GTU in the platoon, with the leader 0
      • isInPlatoon

        public boolean isInPlatoon​(String gtuId)
        Returns whether the GTU is the platoon.
        Parameters:
        gtuId - String; GTU id
        Returns:
        boolean; whether the GTU is the platoon
      • shouldChangeLane

        public LateralDirectionality shouldChangeLane​(String gtuId)
        Returns the direction in which the GTU should change lane.
        Parameters:
        gtuId - String; GTU id
        Returns:
        LateralDirectionality; direction to change to, or NONE
      • laneChangeInProgress

        public boolean laneChangeInProgress()
        Returns true when a lane change is in progress.
        Returns:
        boolean; whether a lane change is currently in progress
      • numberOfChanged

        public int numberOfChanged()
        Number of gtus that have changed lanes.
        Returns:
        int; number of gtus changed lanes currently