Class LaneBasedGTUGenerator

    • Field Detail

      • GTU_GENERATED_EVENT

        public static final EventType GTU_GENERATED_EVENT
        Event of a generated GTU. Payload: LaneBasedIndividualGTU
    • Method Detail

      • setNoLaneChangeDistance

        public void setNoLaneChangeDistance​(Length noLaneChangeDistance)
        Sets the initial distance over which lane changes shouldn't be performed.
        Parameters:
        noLaneChangeDistance - Length; initial distance over which lane changes shouldn't be performed
      • setInstantaneousLaneChange

        public void setInstantaneousLaneChange​(boolean instantaneous)
        Sets whether GTUs will change lane instantaneously.
        Parameters:
        instantaneous - boolean; whether GTUs will change lane instantaneously
      • setErrorHandler

        public void setErrorHandler​(GTUErrorHandler gtuErrorHandler)
        Sets the GTU error handler.
        Parameters:
        gtuErrorHandler - GTUErrorHandler; GTU error handler
      • queueGtu

        public final void queueGtu​(LaneBasedGTUCharacteristics characteristics,
                                   Set<LaneDirection> position)
        Adds a GTU to the generation queue. This method ignores whether vehicle generation is enabled at the location. This allows an external party to govern (over some time) what vehicles are generated.
        Parameters:
        characteristics - LaneBasedGTUCharacteristics; characteristics of GTU to add to the queue
        position - Set<LaneDirection>; position to generate the GTU at
      • getGeneratedGTUs

        public final long getGeneratedGTUs()
        Returns:
        generatedGTUs.
      • getId

        public final String getId()
        Retrieve the id of this LaneBasedGTUGenerator.
        Specified by:
        getId in interface Identifiable
        Returns:
        String; the id of this LaneBasedGTUGenerator
      • disable

        public void disable​(Time start,
                            Time end,
                            Set<LaneDirection> laneDirections)
                     throws SimRuntimeException
        Disable the vehicle generator during the specific time. Underlying processes such as drawing characteristics and headways are continued, but simply will not result in the queuing of the GTU.
        Parameters:
        start - Time; start time
        end - Time; end time
        laneDirections - Set<LaneDirection>; lanes to disable generation on
        Throws:
        SimRuntimeException - if time is incorrect
      • getQueueLengths

        public Map<DirectedPoint,​Integer> getQueueLengths()
        Returns the locations and lengths of generation queues. Note that the provided location may differ from the generator location, as one generator may generate GTU's at different points.
        Specified by:
        getQueueLengths in interface GtuGeneratorQueue
        Returns:
        Map<DirectedPoint, Integer>; locations and lengths of generation queues