public class IMBSampler extends Sampler<GtuData>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Sampler.CompressionMethod| Modifier and Type | Field and Description |
|---|---|
protected GtuTypeData |
defaultGtuType
the default gtu type (for now).
|
protected RouteData |
defaultRoute
the default route (for now).
|
protected Map<String,GtuData> |
gtus
the gtus.
|
protected Map<String,LaneData> |
lanes
the lanes.
|
protected Map<String,KpiLaneDirection> |
lastLanes
last lane of gtus.
|
protected Map<String,LinkData> |
links
the links.
|
protected Map<String,NodeData> |
nodes
the nodes.
|
| Constructor and Description |
|---|
IMBSampler(org.opentrafficsim.imb.connector.IMBConnector imbConnector)
Constructor with listeners for nodes, links, lanes and gtu's.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImbKpiTransceiver(ImbKpiTransceiver<GtuData> imbKpiTransceiver) |
void |
finalizeRecording(KpiLaneDirection kpiLaneDirection) |
void |
initRecording(KpiLaneDirection kpiLaneDirection) |
static void |
main(String[] args)
Main program for IMBSampler.
|
Time |
now() |
protected void |
sample(double timeStamp,
String gtuId,
String laneId,
boolean forward,
double longitudinalPosition,
double speed,
double acceleration)
Sample the data received from a GTU.
|
void |
scheduleStartRecording(Time time,
KpiLaneDirection kpiLaneDirection) |
void |
scheduleStopRecording(Time time,
KpiLaneDirection kpiLaneDirection) |
protected void |
updateClock(double timeStamp)
Updates clock and triggers timed events.
|
contains, contains, equals, getTrajectoryGroup, hashCode, processGtuAddEvent, processGtuMoveEvent, processGtuRemoveEvent, processGtuRemoveEvent, registerExtendedDataType, registerMetaDataTypes, registerSpaceTimeRegion, startRecording, stopRecording, writeToFile, writeToFileprotected final Map<String,KpiLaneDirection> lastLanes
protected final GtuTypeData defaultGtuType
protected final RouteData defaultRoute
public IMBSampler(org.opentrafficsim.imb.connector.IMBConnector imbConnector)
throws org.opentrafficsim.imb.IMBException
imbConnector - IMBConnector; IMB connectionorg.opentrafficsim.imb.IMBException - on connection errorpublic static void main(String[] args) throws org.opentrafficsim.imb.IMBException
args - String[]; the arguments with [0]=IP address, [1]=portorg.opentrafficsim.imb.IMBException - in case of invalid argumentspublic final void scheduleStartRecording(Time time, KpiLaneDirection kpiLaneDirection)
scheduleStartRecording in class Sampler<GtuData>public final void scheduleStopRecording(Time time, KpiLaneDirection kpiLaneDirection)
scheduleStopRecording in class Sampler<GtuData>public final void initRecording(KpiLaneDirection kpiLaneDirection)
initRecording in class Sampler<GtuData>public final void finalizeRecording(KpiLaneDirection kpiLaneDirection)
finalizeRecording in class Sampler<GtuData>protected void sample(double timeStamp,
String gtuId,
String laneId,
boolean forward,
double longitudinalPosition,
double speed,
double acceleration)
timeStamp - double; time of the samplinggtuId - String; gtulaneId - String; laneforward - boolean; driving directionlongitudinalPosition - double; positionspeed - double; speedacceleration - double; accelerationpublic void addImbKpiTransceiver(ImbKpiTransceiver<GtuData> imbKpiTransceiver)
imbKpiTransceiver - ImbKpiTransceiver<GtuData>; add imbKpiTransceiver.protected void updateClock(double timeStamp)
timeStamp - double; most recent time stampCopyright © 2014–2019 Delft University of Technology. All rights reserved.