NonDirectionalOccupancySensor.java

  1. package org.opentrafficsim.road.network.lane.object.sensor;

  2. import java.io.Serializable;

  3. import org.djunits.value.vdouble.scalar.Length;
  4. import org.opentrafficsim.base.Identifiable;
  5. import org.opentrafficsim.core.gtu.RelativePosition;

  6. import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface;
  7. import nl.tudelft.simulation.event.EventType;

  8. /**
  9.  * An occupancy sensor is a lane-based object that can be triggered by a relative position of the GTU (e.g., front, back) when
  10.  * that relative position passes over the sensor location on the lane. XXX
  11.  * <p>
  12.  * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  13.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  14.  * <p>
  15.  * $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
  16.  * initial version Dec 31, 2014 <br>
  17.  * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
  18.  * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
  19.  */
  20. public interface NonDirectionalOccupancySensor extends Serializable, Identifiable
  21. {
  22.     /** @return the relative position type of the vehicle (e.g., FRONT, BACK) that triggers the sensor. */
  23.     RelativePosition.TYPE getPositionTypeEntry();

  24.     /** @return the relative position type of the vehicle (e.g., FRONT, BACK) that triggers the sensor. */
  25.     RelativePosition.TYPE getPositionTypeExit();

  26.     /**
  27.      * Return the A position of this NonDirectionalOccupancySensor.
  28.      * @return Length; the lane and position on the lane where GTU entry is detected
  29.      */
  30.     Length getLanePositionA();

  31.     /**
  32.      * Return the B position of this NonDirectionalOccupancySensor.
  33.      * @return Length; the lane and position on the lane where GTU exit is detected
  34.      */
  35.     Length getLanePositionB();

  36.     /** @return The id of the sensor. */
  37.     @Override
  38.     String getId();

  39.     /** @return The simulator. */
  40.     DEVSSimulatorInterface.TimeDoubleUnit getSimulator();

  41.     /**
  42.      * The <b>timed</b> event type for pub/sub indicating the triggering of the entry of a NonDirectionalOccupancySensor. <br>
  43.      * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE
  44.      * relativePosition}
  45.      */
  46.     EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_ENTRY_EVENT =
  47.             new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.ENTRY");

  48.     /**
  49.      * The <b>timed</b> event type for pub/sub indicating the triggering of the exit of an NonDirectionalOccupancySensor. <br>
  50.      * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE
  51.      * relativePosition}
  52.      */
  53.     EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_EXIT_EVENT = new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.EXIT");

  54.     // TODO enforce clone method

  55. }