View Javadoc
1   package org.opentrafficsim.road.network.lane.object.sensor;
2   
3   import java.io.Serializable;
4   
5   import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
6   import org.opentrafficsim.core.gtu.RelativePosition;
7   import org.opentrafficsim.road.network.lane.object.LaneBasedObject;
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.
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 DirectionalOccupancySensor 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 entry position of this DirectionalOccupancySensor.
33       * @return LaneBasedObject; the lane and position on the lane where GTU entry is detected
34       */
35      LaneBasedObject getLanePositionEntry();
36  
37      /**
38       * Return the exit position of this DirectionalOccupancySensor.
39       * @return LaneBasedObject; the lane and position on the lane where GTU exit is detected
40       */
41      LaneBasedObject getLanePositionExit();
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 an OccupancySensor. <br>
51       * Payload: Object[] {String sensorId, Sensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE relativePosition}
52       */
53      EventType DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_ENTRY_EVENT = new EventType("DIRECTIONALOCCUPANCYSENSOR.TRIGGER.ENTRY");
54  
55      /**
56       * The <b>timed</b> event type for pub/sub indicating the triggering of the exit of an OccupancySensor. <br>
57       * Payload: Object[] {String sensorId, Sensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE relativePosition}
58       */
59      EventType DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_EXIT_EVENT = new EventType("DIRECTIONALOCCUPANCYSENSOR.TRIGGER.EXIT");
60  
61      // TODO enforce clone method
62  
63  }