Class FlankSensor

    • Constructor Detail

      • FlankSensor

        public FlankSensor​(String id,
                           Lane lane,
                           Length longitudinalPosition,
                           RelativePosition.TYPE positionType,
                           OTSSimulatorInterface simulator,
                           TrafficLightSensor parent,
                           Compatible compatible)
                    throws NetworkException
        Construct a new FlankSensor.
        Parameters:
        id - String; the name of the new FlankSensor
        lane - Lane; the lane of the new FlankSensor
        longitudinalPosition - Length; the longitudinal position of the new FlankSensor
        positionType - TYPE; the position on the GTUs that triggers the new FlankSensor
        simulator - OTSSimulatorInterface; the simulator engine
        parent - TrafficLightSensor; the traffic light sensor that deploys this FlankSensor
        compatible - Compatible; object that determines if a GTU is detectable by the new FlankSensor
        Throws:
        NetworkException - when the network is inconsistent
    • Method Detail

      • triggerResponse

        protected 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 final FlankSensor 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
      • getParent

        public final TrafficLightSensor getParent()
        Return the parent (TrafficLightSensor) of this FlankSensor.
        Returns:
        TrafficLightSensor; the parent of this flank sensor