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 | defaultGtuTypethe default gtu type (for now). | 
| protected RouteData | defaultRoutethe default route (for now). | 
| protected Map<String,GtuData> | gtusthe gtus. | 
| protected Map<String,LaneData> | lanesthe lanes. | 
| protected Map<String,org.opentrafficsim.kpi.sampling.KpiLaneDirection> | lastLaneslast lane of gtus. | 
| protected Map<String,LinkData> | linksthe links. | 
| protected Map<String,NodeData> | nodesthe 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, stopRecordingprotected 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.Samplerpublic final void scheduleStartRecording(org.djunits.value.vdouble.scalar.Time time,
                                         org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
scheduleStartRecording in class org.opentrafficsim.kpi.sampling.Samplerpublic final void scheduleStopRecording(org.djunits.value.vdouble.scalar.Time time,
                                        org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
scheduleStopRecording in class org.opentrafficsim.kpi.sampling.Samplerpublic final void initRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
initRecording in class org.opentrafficsim.kpi.sampling.Samplerpublic final void finalizeRecording(org.opentrafficsim.kpi.sampling.KpiLaneDirection kpiLaneDirection)
finalizeRecording in class org.opentrafficsim.kpi.sampling.Samplerprotected 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.