Class RoadSampler
java.lang.Object
org.opentrafficsim.kpi.sampling.Sampler<GtuData>
org.opentrafficsim.road.network.sampling.RoadSampler
- All Implemented Interfaces:
java.io.Serializable,java.util.EventListener,EventListenerInterface
public class RoadSampler extends Sampler<GtuData> implements EventListenerInterface
Implementation of kpi sampler for OTS.
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 12 okt. 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opentrafficsim.kpi.sampling.Sampler
Sampler.CompressionMethod -
Constructor Summary
Constructors Constructor Description RoadSampler(DEVSSimulatorInterface.TimeDoubleUnit simulator)Constructor which uses the operational plan updates of GTU's as sampling interval.RoadSampler(DEVSSimulatorInterface.TimeDoubleUnit simulator, Frequency frequency)Constructor which uses the given frequency to determine the sampling interval. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)voidfinalizeRecording(KpiLaneDirection kpiLaneDirection)inthashCode()voidinitRecording(KpiLaneDirection kpiLaneDirection)voidnotify(EventInterface event)voidnotifySample(LaneBasedGTU gtu, LaneDirection laneDirection)Samples a gtu and schedules the next sampling event.Timenow()voidscheduleStartRecording(Time time, KpiLaneDirection kpiLaneDirection)voidscheduleStopRecording(Time time, KpiLaneDirection kpiLaneDirection)java.lang.StringtoString()Methods inherited from class org.opentrafficsim.kpi.sampling.Sampler
contains, contains, getTrajectoryGroup, processGtuAddEvent, processGtuMoveEvent, processGtuRemoveEvent, processGtuRemoveEvent, registerExtendedDataType, registerMetaDataTypes, registerSpaceTimeRegion, startRecording, stopRecording, writeToFile, writeToFile
-
Constructor Details
-
RoadSampler
Constructor which uses the operational plan updates of GTU's as sampling interval.- Parameters:
simulator- DEVSSimulatorInterface.TimeDoubleUnit; simulator- Throws:
java.lang.NullPointerException- if the simulator isnull
-
RoadSampler
Constructor which uses the given frequency to determine the sampling interval.- Parameters:
simulator- DEVSSimulatorInterface.TimeDoubleUnit; simulatorfrequency- Frequency; sampling frequency- Throws:
java.lang.NullPointerException- if an input isnulljava.lang.IllegalArgumentException- if frequency is negative or zero
-
-
Method Details
-
now
-
scheduleStartRecording
- Specified by:
scheduleStartRecordingin classSampler<GtuData>
-
scheduleStopRecording
- Specified by:
scheduleStopRecordingin classSampler<GtuData>
-
initRecording
- Specified by:
initRecordingin classSampler<GtuData>
-
finalizeRecording
- Specified by:
finalizeRecordingin classSampler<GtuData>
-
notify
- Specified by:
notifyin interfaceEventListenerInterface- Throws:
java.rmi.RemoteException
-
notifySample
Samples a gtu and schedules the next sampling event.- Parameters:
gtu- LaneBasedGTU; gtu to samplelaneDirection- LaneDirection; lane direction where the gtu is at
-
hashCode
public final int hashCode() -
equals
public final boolean equals(java.lang.Object obj) -
toString
public final java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-