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