View Javadoc
1   package org.opentrafficsim.road.network.lane.object.sensor;
2   
3   import java.io.Serializable;
4   
5   import org.djunits.value.vdouble.scalar.Length;
6   import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
7   import org.opentrafficsim.core.gtu.RelativePosition;
8   
9   import nl.tudelft.simulation.event.EventType;
10  
11  /**
12   * An occupancy sensor is a lane-based object that can be triggered by a relative position of the GTU (e.g., front, back) when
13   * that relative position passes over the sensor location on the lane. XXX
14   * <p>
15   * Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
16   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
17   * <p>
18   * $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
19   * initial version Dec 31, 2014 <br>
20   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
21   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
22   */
23  public interface NonDirectionalOccupancySensor extends Serializable
24  {
25      /** @return the relative position type of the vehicle (e.g., FRONT, BACK) that triggers the sensor. */
26      RelativePosition.TYPE getPositionTypeEntry();
27  
28      /** @return the relative position type of the vehicle (e.g., FRONT, BACK) that triggers the sensor. */
29      RelativePosition.TYPE getPositionTypeExit();
30  
31      /**
32       * Return the A position of this NonDirectionalOccupancySensor.
33       * @return Length; the lane and position on the lane where GTU entry is detected
34       */
35      Length getLanePositionA();
36  
37      /**
38       * Return the B position of this NonDirectionalOccupancySensor.
39       * @return Length; the lane and position on the lane where GTU exit is detected
40       */
41      Length getLanePositionB();
42  
43      /** @return The id of the sensor. */
44      String getId();
45  
46      /** @return The simulator. */
47      OTSDEVSSimulatorInterface getSimulator();
48  
49      /**
50       * The <b>timed</b> event type for pub/sub indicating the triggering of the entry of a NonDirectionalOccupancySensor. <br>
51       * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE
52       * relativePosition}
53       */
54      EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_ENTRY_EVENT =
55              new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.ENTRY");
56  
57      /**
58       * The <b>timed</b> event type for pub/sub indicating the triggering of the exit of an NonDirectionalOccupancySensor. <br>
59       * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE
60       * relativePosition}
61       */
62      EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_EXIT_EVENT = new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.EXIT");
63  
64      // TODO enforce clone method
65  
66  }