public class Detector extends AbstractSensor
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Class and Description |
|---|---|
static class |
Detector.CompressionMethod
Defines the compression method for stored data.
|
static interface |
Detector.DetectorMeasurement<C,A>
Interface for what detectors measure.
|
(package private) static class |
Detector.PlatoonMeasurement
Cumulative information for platoon size measurement.
|
static class |
Detector.PlatoonSizes
Measurement of platoon sizes based on time between previous GTU exit and GTU entry.
|
| Modifier and Type | Field and Description |
|---|---|
static nl.tudelft.simulation.event.EventType |
DETECTOR_AGGREGATE
Aggregation event.
|
static nl.tudelft.simulation.event.EventType |
DETECTOR_TRIGGERED
Trigger event.
|
static Detector.DetectorMeasurement<Double,org.djunits.value.vdouble.scalar.Speed> |
HARMONIC_MEAN_SPEED
Harmonic mean speed measurement.
|
static Detector.DetectorMeasurement<Double,org.djunits.value.vdouble.scalar.Speed> |
MEAN_SPEED
Mean speed measurement.
|
static Detector.DetectorMeasurement<Double,Double> |
OCCUPANCY
Occupancy measurement.
|
static Detector.DetectorMeasurement<List<Double>,List<Double>> |
PASSAGES
Passages measurement.
|
DEFAULT_SENSOR_ELEVATION, SENSOR_TRIGGER_EVENT| Constructor and Description |
|---|
Detector(String id,
Lane lane,
org.djunits.value.vdouble.scalar.Length longitudinalPosition,
org.djunits.value.vdouble.scalar.Length length,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
org.djunits.value.vdouble.scalar.Duration aggregation,
Detector.DetectorMeasurement<?,?>... measurements)
Constructor.
|
Detector(String id,
Lane lane,
org.djunits.value.vdouble.scalar.Length longitudinalPosition,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator)
Constructor for regular Dutch dual-loop detectors measuring flow and mean speed aggregated over 60s.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) <C> void |
accumulate(Detector.DetectorMeasurement<C,?> measurement,
LaneBasedGTU gtu,
boolean front)
Accumulates a measurement.
|
AbstractSensor |
clone(CrossSectionElement newCSE,
org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator,
boolean animation)
Clone the LaneBasedObject for e.g., copying a network.
|
org.djunits.value.vdouble.scalar.Length |
getLength()
Returns the detector length.
|
Map<Detector.DetectorMeasurement<?,?>,Object> |
getMesoMeasurements()
Returns a map of non-periodical measurements.
|
static String |
printListDouble(List<Double> list,
String format)
Prints a list of doubles in to a formatted string.
|
static String |
removeTrailingZeros(String string)
Remove any trailing zeros.
|
protected void |
triggerResponse(LaneBasedGTU gtu)
Implementation of the response to a trigger of this sensor by a GTU.
|
static void |
writeToFile(org.opentrafficsim.core.network.OTSNetwork network,
String file,
boolean periodic)
Write the contents of all detectors in to a file.
|
static <C> void |
writeToFile(org.opentrafficsim.core.network.OTSNetwork network,
String file,
boolean periodic,
String format,
Detector.CompressionMethod compression)
Write the contents of all detectors in to a file.
|
compareTo, equals, getDetectedGTUTypes, getPositionType, getSimulator, hashCode, isCompatible, toString, triggerclone, getDirection, getFullId, getLane, getLocation, getLongitudinalPositiongetBounds, getGeometry, getHeight, getIdaddListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBounds, getDirection, getLane, getLocation, getLongitudinalPositionpublic static final nl.tudelft.simulation.event.EventType DETECTOR_TRIGGERED
public static final nl.tudelft.simulation.event.EventType DETECTOR_AGGREGATE
public static final Detector.DetectorMeasurement<Double,org.djunits.value.vdouble.scalar.Speed> MEAN_SPEED
public static final Detector.DetectorMeasurement<Double,org.djunits.value.vdouble.scalar.Speed> HARMONIC_MEAN_SPEED
public static final Detector.DetectorMeasurement<Double,Double> OCCUPANCY
public static final Detector.DetectorMeasurement<List<Double>,List<Double>> PASSAGES
public Detector(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator) throws org.opentrafficsim.core.network.NetworkException
id - String; detector idlane - Lane; lanelongitudinalPosition - Length; positionsimulator - OTSDEVSSimulatorInterface; simulatororg.opentrafficsim.core.network.NetworkException - on network exceptionpublic Detector(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, org.djunits.value.vdouble.scalar.Length length, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator, org.djunits.value.vdouble.scalar.Duration aggregation, Detector.DetectorMeasurement<?,?>... measurements) throws org.opentrafficsim.core.network.NetworkException
id - String; detector idlane - Lane; lanelongitudinalPosition - Length; positionlength - Length; lengthsimulator - OTSDEVSSimulatorInterface; simulatoraggregation - Duration; aggregation periodmeasurements - DetectorMeasurement...; measurements to obtainorg.opentrafficsim.core.network.NetworkException - on network exceptionpublic org.djunits.value.vdouble.scalar.Length getLength()
protected void triggerResponse(LaneBasedGTU gtu)
triggerResponse in class AbstractSensorgtu - LaneBasedGTU; the lane based GTU that triggered this sensor.<C> void accumulate(Detector.DetectorMeasurement<C,?> measurement, LaneBasedGTU gtu, boolean front)
C - accumulated typemeasurement - DetectorMeasurement; measurement to accumulategtu - LaneBasedGTU; gtufront - boolean; triggered by front entering (or rear leaving when false)public Map<Detector.DetectorMeasurement<?,?>,Object> getMesoMeasurements()
public AbstractSensor clone(CrossSectionElement newCSE, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator, boolean animation) throws org.opentrafficsim.core.network.NetworkException
clone in class AbstractSensornewCSE - CrossSectionElement; the new cross section element to which the clone belongsnewSimulator - OTSSimulatorInterface; the new simulator for this networkanimation - boolean; whether to (re)create animation or notorg.opentrafficsim.core.network.NetworkException - in case the cloning failspublic static final void writeToFile(org.opentrafficsim.core.network.OTSNetwork network,
String file,
boolean periodic)
network - OTSNetwork; networkfile - String; fileperiodic - boolean; periodic datapublic static final <C> void writeToFile(org.opentrafficsim.core.network.OTSNetwork network,
String file,
boolean periodic,
String format,
Detector.CompressionMethod compression)
C - accumulated typenetwork - OTSNetwork; networkfile - String; fileperiodic - boolean; periodic dataformat - String; number format, as used in String.format()compression - how to compress the datapublic static final String removeTrailingZeros(String string)
string - String; string of numberCopyright © 2014–2018 Delft University of Technology. All rights reserved.