Class SinkSensor

    • Constructor Detail

      • SinkSensor

        public SinkSensor​(Lane lane,
                          Length position,
                          GTUDirectionality gtuDirectionality,
                          OTSSimulatorInterface simulator)
                   throws NetworkException
        Parameters:
        lane - Lane; the lane that triggers the deletion of the GTU.
        position - Length; the position of the sensor
        gtuDirectionality - GTUDirectionality; GTU directionality
        simulator - OTSSimulatorInterface; the simulator to enable animation.
        Throws:
        NetworkException - when the position on the lane is out of bounds w.r.t. the center line of the lane
      • SinkSensor

        public SinkSensor​(Lane lane,
                          Length position,
                          Compatible compatible,
                          OTSSimulatorInterface simulator)
                   throws NetworkException
        Parameters:
        lane - Lane; the lane that triggers the deletion of the GTU.
        position - Length; the position of the sensor
        compatible - Compatible; compatible GTU type and direction
        simulator - OTSSimulatorInterface; the simulator to enable animation.
        Throws:
        NetworkException - when the position on the lane is out of bounds w.r.t. the center line of the lane
    • Method Detail

      • triggerResponse

        public final void triggerResponse​(LaneBasedGTU gtu)
        Implementation of the response to a trigger of this sensor by a GTU.
        Specified by:
        triggerResponse in class AbstractSensor
        Parameters:
        gtu - LaneBasedGTU; the lane based GTU that triggered this sensor.
      • clone

        public SinkSensor clone​(CrossSectionElement newCSE,
                                OTSSimulatorInterface newSimulator)
                         throws NetworkException
        Clone the LaneBasedObject for e.g., copying a network.
        Specified by:
        clone in class AbstractSensor
        Parameters:
        newCSE - CrossSectionElement; the new cross section element to which the clone belongs
        newSimulator - OTSSimulatorInterface; the new simulator for this network
        Returns:
        AbstractLaneBasedObject; a clone of this object
        Throws:
        NetworkException - in case the cloning fails