public class IMBSampler
extends org.opentrafficsim.kpi.sampling.Sampler
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
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,org.opentrafficsim.kpi.sampling.KpiLaneDirection> |
lastLanes
last lane of gtus.
|
protected Map<String,LinkData> |
links
the links.
|
protected Map<String,NodeData> |
nodes
the nodes.
|
Constructor and Description |
---|
IMBSampler(String host,
int port,
String modelName,
int modelId,
String federation)
Constructor which starts the IMB connection, with listeners for nodes, links, lanes and gtu's.
|
Modifier and Type | Method and Description |
---|---|
void |
finalizeRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection) |
void |
initRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection) |
static void |
main(String[] args)
Main program for IMBSampler.
|
org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.Time time,
org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection) |
void |
scheduleStopRecording(org.djunits.value.vdouble.scalar.Time time,
org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection) |
protected void |
updateClock(double timeStamp)
Updates clock and triggers timed events.
|
contains, equals, getTrajectoryGroup, hashCode, processGtuAddEvent, processGtuMoveEvent, processGtuRemoveEvent, processGtuRemoveEvent, registerExtendedDataType, registerMetaDataTypes, registerSpaceTimeRegion, startRecording, stopRecording
protected final Map<String,org.opentrafficsim.kpi.sampling.KpiLaneDirection> lastLanes
protected final GtuTypeData defaultGtuType
protected final RouteData defaultRoute
public IMBSampler(String host, int port, String modelName, int modelId, String federation) throws org.opentrafficsim.imb.IMBException
host
- String; name of the IMB hubport
- int; port number of the IMB hubmodelName
- String; local model namemodelId
- int; model idfederation
- String; federation on the IMB huborg.opentrafficsim.imb.IMBException
- when a connection to the IMB hub could not be establishedpublic static void main(String[] args) throws org.opentrafficsim.imb.IMBException
args
- the arguments with [0]=IP address, [1]=portorg.opentrafficsim.imb.IMBException
- in case of invalid argumentspublic final org.djunits.value.vdouble.scalar.Time now()
now
in class org.opentrafficsim.kpi.sampling.Sampler
public final void scheduleStartRecording(org.djunits.value.vdouble.scalar.Time time, org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
scheduleStartRecording
in class org.opentrafficsim.kpi.sampling.Sampler
public final void scheduleStopRecording(org.djunits.value.vdouble.scalar.Time time, org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
scheduleStopRecording
in class org.opentrafficsim.kpi.sampling.Sampler
public final void initRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
initRecording
in class org.opentrafficsim.kpi.sampling.Sampler
public final void finalizeRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
finalizeRecording
in class org.opentrafficsim.kpi.sampling.Sampler
protected void sample(double timeStamp, String gtuId, String laneId, boolean forward, double longitudinalPosition, double speed, double acceleration)
timeStamp
- gtuId
- laneId
- forward
- longitudinalPosition
- speed
- acceleration
- protected void updateClock(double timeStamp)
timeStamp
- most recent time stampCopyright © 2014–2016 Delft University of Technology. All rights reserved.