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 boolean
equals(java.lang.Object obj)
void
finalizeRecording(KpiLaneDirection kpiLaneDirection)
int
hashCode()
void
initRecording(KpiLaneDirection kpiLaneDirection)
void
notify(EventInterface event)
void
notifySample(LaneBasedGTU gtu, LaneDirection laneDirection)
Samples a gtu and schedules the next sampling event.Time
now()
void
scheduleStartRecording(Time time, KpiLaneDirection kpiLaneDirection)
void
scheduleStopRecording(Time time, KpiLaneDirection kpiLaneDirection)
java.lang.String
toString()
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 isnull
java.lang.IllegalArgumentException
- if frequency is negative or zero
-
-
Method Details
-
now
-
scheduleStartRecording
- Specified by:
scheduleStartRecording
in classSampler<GtuData>
-
scheduleStopRecording
- Specified by:
scheduleStopRecording
in classSampler<GtuData>
-
initRecording
- Specified by:
initRecording
in classSampler<GtuData>
-
finalizeRecording
- Specified by:
finalizeRecording
in classSampler<GtuData>
-
notify
- Specified by:
notify
in 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:
toString
in classjava.lang.Object
-