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.base.Identifiable; 7 import org.opentrafficsim.core.gtu.RelativePosition; 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. XXX 15 * <p> 16 * Copyright (c) 2013-2018 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 NonDirectionalOccupancySensor 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 A position of this NonDirectionalOccupancySensor. 34 * @return Length; the lane and position on the lane where GTU entry is detected 35 */ 36 Length getLanePositionA(); 37 38 /** 39 * Return the B position of this NonDirectionalOccupancySensor. 40 * @return Length; the lane and position on the lane where GTU exit is detected 41 */ 42 Length getLanePositionB(); 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 a NonDirectionalOccupancySensor. <br> 53 * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE 54 * relativePosition} 55 */ 56 EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_ENTRY_EVENT = 57 new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.ENTRY"); 58 59 /** 60 * The <b>timed</b> event type for pub/sub indicating the triggering of the exit of an NonDirectionalOccupancySensor. <br> 61 * Payload: Object[] {String sensorId, NonDirectionalOccupancySensor sensor, LaneBasedGTU gtu, RelativePosition.TYPE 62 * relativePosition} 63 */ 64 EventType NON_DIRECTIONAL_OCCUPANCY_SENSOR_TRIGGER_EXIT_EVENT = new EventType("NONDIRECTIONALOCCUPANCYSENSOR.TRIGGER.EXIT"); 65 66 // TODO enforce clone method 67 68 }