Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSFCDExport.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2012-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// Realises dumping Floating Car Data (FCD) Data
22/****************************************************************************/
23#include <config.h>
24
30#include <libsumo/Helper.h>
34#include <microsim/MSEdge.h>
35#include <microsim/MSLane.h>
36#include <microsim/MSGlobals.h>
37#include <microsim/MSNet.h>
38#include <microsim/MSVehicle.h>
43#include <mesosim/MEVehicle.h>
44#include "MSEmissionExport.h"
45#include "MSFCDExport.h"
46
47
48// ===========================================================================
49// method definitions
50// ===========================================================================
51void
52MSFCDExport::write(OutputDevice& of, const SUMOTime timestep, const SumoXMLTag tag) {
54 const SUMOTime period = MSDevice_FCD::getPeriod();
55 const SUMOTime begin = MSDevice_FCD::getBegin();
56 if ((period > 0 && (timestep - begin) % period != 0) || timestep < begin) {
57 return;
58 }
60 const bool useGeo = MSDevice_FCD::useGeo();
61 const bool useUTM = MSDevice_FCD::useUTM();
62 const double maxLeaderDistance = MSDevice_FCD::getMaxLeaderDistance();
63 const std::vector<std::string>& params = MSDevice_FCD::getParamsToWrite();
66 const double radius = MSDevice_FCD::getRadius();
67 const bool filter = MSDevice_FCD::getEdgeFilter().size() > 0;
68 const bool shapeFilter = MSDevice_FCD::hasShapeFilter();
69 std::set<const Named*> inRadius;
70 if (radius > 0) {
71 // collect all vehicles in radius around equipped vehicles
72 for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) {
73 const SUMOVehicle* veh = it->second;
74 if (isVisible(veh) && hasOwnOutput(veh, filter, shapeFilter)) {
75 PositionVector shape;
76 shape.push_back(veh->getPosition());
79 }
80 }
81 }
82
83 bool wroteTimestep = false;
84 auto openTimestep = [&]() {
85 if (!wroteTimestep) {
86 of.openTag("timestep").writeTime(SUMO_ATTR_TIME, timestep);
87 wroteTimestep = true;
88 }
89 };
91 openTimestep();
92 }
93 for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) {
94 const SUMOVehicle* const veh = it->second;
95 if (isVisible(veh)) {
96 const bool hasOutput = (tag == SUMO_TAG_NOTHING || tag == SUMO_TAG_VEHICLE) && hasOwnOutput(veh, filter, shapeFilter, (radius > 0 && inRadius.count(veh) > 0));
97 if (hasOutput) {
98 openTimestep();
99 const MSVehicle* const microVeh = MSGlobals::gUseMesoSim ? nullptr : static_cast<const MSVehicle*>(veh);
100 Position pos = veh->getPosition();
101 if (useGeo) {
104 } else if (useUTM) {
105 pos.sub(GeoConvHelper::getFinal().getOffset());
106 }
108 of.writeAttr(SUMO_ATTR_ID, veh->getID());
109 of.writeOptionalAttr(SUMO_ATTR_X, pos.x(), mask);
110 of.writeOptionalAttr(SUMO_ATTR_Y, pos.y(), mask);
112 of.writeOptionalAttr(SUMO_ATTR_Z, pos.z(), mask);
113 of.writeFuncAttr(SUMO_ATTR_ANGLE, [ = ]() {
114 return GeomHelper::naviDegree(veh->getAngle());
115 }, mask);
116 of.writeFuncAttr(SUMO_ATTR_TYPE, [ = ]() {
117 return veh->getVehicleType().getID();
118 }, mask);
119 of.writeFuncAttr(SUMO_ATTR_SPEED, [ = ]() {
120 return veh->getSpeed();
121 }, mask);
123 const double speedLimit = veh->getEdge()->getSpeedLimit();
124 return speedLimit > 0 ? veh->getSpeed() / speedLimit : 0.;
125 }, mask);
127 return veh->getPositionOnLane();
128 }, mask);
129 of.writeFuncAttr(SUMO_ATTR_LANE, [ = ]() {
130 return MSGlobals::gUseMesoSim ? "" : microVeh->getLane()->getID();
131 }, mask, MSGlobals::gUseMesoSim);
132 of.writeFuncAttr(SUMO_ATTR_EDGE, [ = ]() {
133 return veh->getCurrentEdge()->getID();
134 }, mask, !MSGlobals::gUseMesoSim);
135 of.writeFuncAttr(SUMO_ATTR_SLOPE, [ = ]() {
136 return veh->getSlope();
137 }, mask);
139 of.writeFuncAttr(SUMO_ATTR_SIGNALS, [ = ]() {
140 return microVeh->getSignals();
141 }, mask);
143 return microVeh->getAcceleration();
144 }, mask);
146 return microVeh->getLaneChangeModel().getAccelerationLat();
147 }, mask);
149 return GeomHelper::vectorize(microVeh->getSpeed(), microVeh->getAngle());
150 }, mask);
152 return GeomHelper::vectorize(microVeh->getAcceleration(), microVeh->getAngle());
153 }, mask);
154 }
156 double lanePos = veh->getPositionOnLane();
157 if (!MSGlobals::gUseMesoSim && microVeh->getLane()->isInternal()) {
158 lanePos = microVeh->getRoute().getDistanceBetween(0., lanePos, microVeh->getEdge()->getLanes()[0], microVeh->getLane(),
159 microVeh->getRoutePosition());
160 }
161 return veh->getEdge()->getDistanceAt(lanePos);
162 }, mask);
164 return veh->getOdometer();
165 }, mask);
167 return veh->getLateralPositionOnLane();
168 }, mask);
171 return microVeh->getLaneChangeModel().getSpeedLat();
172 }, mask);
173 }
174 if (maxLeaderDistance >= 0 && !MSGlobals::gUseMesoSim) {
175 const std::pair<const MSVehicle* const, double> leader = microVeh->getLeader(maxLeaderDistance);
176 if (leader.first != nullptr) {
178 return leader.first->getID();
179 }, mask);
181 return leader.first->getSpeed();
182 }, mask);
184 return leader.second + microVeh->getVehicleType().getMinGap();
185 }, mask);
186 } else {
188 return "";
189 }, mask);
191 return -1;
192 }, mask);
194 return -1;
195 }, mask);
196 }
197 }
198 for (const std::string& key : params) {
199 std::string error;
200 const std::string value = static_cast<const MSBaseVehicle*>(veh)->getPrefixedParameter(key, error);
201 if (value != "") {
203 }
204 }
206 const double arrivalDelay = static_cast<const MSBaseVehicle*>(veh)->getStopArrivalDelay();
207 if (arrivalDelay == INVALID_DOUBLE) {
208 // no upcoming stop also means that there is no delay
209 return 0.;
210 }
211 return arrivalDelay;
212 }, mask);
213 of.writeFuncAttr(SUMO_ATTR_DELAY, [ = ]() {
214 const double delay = static_cast<const MSBaseVehicle*>(veh)->getStopDelay();
215 if (delay < 0) {
216 // no upcoming stop also means that there is no delay
217 return 0.;
218 }
219 return delay;
220 }, mask);
222 const MEVehicle* mesoVeh = static_cast<const MEVehicle*>(veh);
223 of.writeFuncAttr(SUMO_ATTR_SEGMENT, [ = ]() {
224 return mesoVeh->getSegmentIndex();
225 }, mask);
226 of.writeFuncAttr(SUMO_ATTR_QUEUE, [ = ]() {
227 return mesoVeh->getQueIndex();
228 }, mask);
230 return mesoVeh->getLastEntryTimeSeconds();
231 }, mask);
233 return mesoVeh->getEventTimeSeconds();
234 }, mask);
236 return mesoVeh->getBlockTime() == SUMOTime_MAX ? -1.0 : mesoVeh->getBlockTimeSeconds();
237 }, mask);
238 }
239 of.writeFuncAttr(SUMO_ATTR_TAG, [ = ]() {
241 }, mask);
244 MSEmissionExport::writeEmissions(of, static_cast<const MSBaseVehicle*>(veh), false, mask);
245 of.closeTag();
246 }
247 // write persons and containers in the vehicle
248 if (tag == SUMO_TAG_NOTHING || tag == SUMO_TAG_PERSON) {
249 const MSEdge* edge = MSGlobals::gUseMesoSim ? veh->getEdge() : &veh->getLane()->getEdge();
250 for (const MSTransportable* const person : veh->getPersons()) {
251 if (hasOwnOutput(person, filter, shapeFilter, inRadius.count(person) > 0)) {
252 openTimestep();
253 writeTransportable(of, edge, person, veh, SUMO_TAG_PERSON, useGeo, mask);
254 }
255 }
256 for (const MSTransportable* const container : veh->getContainers()) {
257 if (hasOwnOutput(container, filter, shapeFilter, inRadius.count(container) > 0)) {
258 openTimestep();
259 writeTransportable(of, edge, container, veh, SUMO_TAG_CONTAINER, useGeo, mask);
260 }
261 }
262 }
263 }
264 }
265 if (tag == SUMO_TAG_NOTHING || tag == SUMO_TAG_PERSON) {
266 if (net->hasPersons() && net->getPersonControl().hasTransportables()) {
267 // write persons who are not in a vehicle
268 for (const MSEdge* const e : net->getEdgeControl().getEdges()) {
269 if (filter && MSDevice_FCD::getEdgeFilter().count(e) == 0) {
270 continue;
271 }
272 for (const MSTransportable* const person : e->getSortedPersons(timestep)) {
273 if (hasOwnOutput(person, filter, shapeFilter, inRadius.count(person) > 0)) {
274 openTimestep();
275 writeTransportable(of, e, person, nullptr, SUMO_TAG_PERSON, useGeo, mask);
276 }
277 }
278 }
279 }
280 if (net->hasContainers() && net->getContainerControl().hasTransportables()) {
281 // write containers which are not in a vehicle
282 for (const MSEdge* const e : net->getEdgeControl().getEdges()) {
283 if (filter && MSDevice_FCD::getEdgeFilter().count(e) == 0) {
284 continue;
285 }
286 for (MSTransportable* container : e->getSortedContainers(timestep)) {
287 if (hasOwnOutput(container, filter, shapeFilter, inRadius.count(container) > 0)) {
288 openTimestep();
289 writeTransportable(of, e, container, nullptr, SUMO_TAG_CONTAINER, useGeo, mask);
290 }
291 }
292 }
293 }
294 }
295 if (wroteTimestep) {
296 of.closeTag();
297 }
298}
299
300
301bool
303 return veh->isOnRoad() || veh->isParking() || veh->isRemoteControlled();
304}
305
306
307bool
308MSFCDExport::hasOwnOutput(const SUMOVehicle* veh, bool filter, bool shapeFilter, bool isInRadius) {
309 return ((!filter || MSDevice_FCD::getEdgeFilter().count(veh->getEdge()) > 0)
310 && (!shapeFilter || MSDevice_FCD::shapeFilter(veh))
311 && ((veh->getDevice(typeid(MSDevice_FCD)) != nullptr) || isInRadius));
312}
313
314
315bool
316MSFCDExport::hasOwnOutput(const MSTransportable* p, bool filter, bool shapeFilter, bool isInRadius) {
317 return ((!filter || MSDevice_FCD::getEdgeFilter().count(p->getEdge()) > 0)
318 && (!shapeFilter || MSDevice_FCD::shapeFilter(p))
319 && ((p->getDevice(typeid(MSTransportableDevice_FCD)) != nullptr) || isInRadius));
320}
321
322
323void
324MSFCDExport::writeTransportable(OutputDevice& of, const MSEdge* const e, const MSTransportable* const p, const SUMOVehicle* const v,
325 const SumoXMLTag tag, const bool useGeo, const SumoXMLAttrMask mask) {
326 Position pos = p->getPosition();
327 if (useGeo) {
330 }
331 of.openTag(tag);
332 of.writeAttr(SUMO_ATTR_ID, p->getID());
333 of.writeOptionalAttr(SUMO_ATTR_X, pos.x(), mask);
334 of.writeOptionalAttr(SUMO_ATTR_Y, pos.y(), mask);
336 of.writeOptionalAttr(SUMO_ATTR_Z, pos.z(), mask);
340 of.writeOptionalAttr(SUMO_ATTR_SPEEDREL, e->getSpeedLimit() > 0 ? p->getSpeed() / e->getSpeedLimit() : 0., mask);
342 of.writeOptionalAttr(SUMO_ATTR_LANE, "", mask, true);
343 of.writeOptionalAttr(SUMO_ATTR_EDGE, e->getID(), mask);
344 of.writeOptionalAttr(SUMO_ATTR_SLOPE, e->getLanes()[0]->getShape().slopeDegreeAtOffset(p->getEdgePos()), mask);
345 of.writeOptionalAttr(SUMO_ATTR_VEHICLE, v == nullptr ? "" : v->getID(), mask);
348 of.closeTag();
349}
350
351
352/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
#define SUMOTime_MAX
Definition SUMOTime.h:34
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_VEHICLE
description of a vehicle
@ SUMO_TAG_CONTAINER
@ SUMO_TAG_PERSON
std::bitset< 96 > SumoXMLAttrMask
@ SUMO_ATTR_LANE
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_Y
@ SUMO_ATTR_Z
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_X
@ SUMO_ATTR_SPEEDREL
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ODOMETER
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_ACCEL_VEC
@ SUMO_ATTR_TAG
@ SUMO_ATTR_SIGNALS
@ SUMO_ATTR_LEADER_GAP
@ SUMO_ATTR_QUEUE
@ SUMO_ATTR_ACCELERATION_LAT
@ SUMO_ATTR_ARRIVALDELAY
@ SUMO_ATTR_BLOCKTIME
@ SUMO_ATTR_SLOPE
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_ACCELERATION
@ SUMO_ATTR_LEADER_SPEED
@ SUMO_ATTR_DISTANCE
@ SUMO_ATTR_SPEED_VEC
@ SUMO_ATTR_VEHICLE
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_EVENTTIME
@ SUMO_ATTR_SEGMENT
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_STAGE
@ SUMO_ATTR_ID
@ SUMO_ATTR_SPEED_LAT
@ SUMO_ATTR_ENTRYTIME
@ SUMO_ATTR_DELAY
@ SUMO_ATTR_LEADER_ID
@ SUMO_ATTR_POSITION
@ SUMO_ATTR_TIME
trigger: the time of the step
int gPrecision
the precision for floating point outputs
Definition StdDefs.cpp:27
int gPrecisionGeo
Definition StdDefs.cpp:29
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static Position vectorize(double val, double radianAngle)
static double naviDegree(const double angle)
A vehicle from the mesoscopic point of view.
Definition MEVehicle.h:42
double getLastEntryTimeSeconds() const
Returns the entry time for the current segment.
Definition MEVehicle.h:305
double getBlockTimeSeconds() const
Returns the time at which the vehicle was blocked on the current segment.
Definition MEVehicle.h:310
int getQueIndex() const
Returns the index of the que the vehicle is in.
Definition MEVehicle.h:238
int getSegmentIndex() const
double getEventTimeSeconds() const
Returns the earliest leave time for the current segment.
Definition MEVehicle.h:300
SUMOTime getBlockTime() const
Returns the time at which the vehicle was blocked.
Definition MEVehicle.h:283
double getAccelerationLat() const
return the lateral speed of the current lane change maneuver
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
The base class for microscopic and mesoscopic vehicles.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
const MSRoute & getRoute() const
Returns the current route.
int getRoutePosition() const
return index of edge within route
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
A device which collects info on the vehicle trip (mainly on departure and arrival)
static const std::set< const MSEdge * > & getEdgeFilter()
static SUMOTime getPeriod()
static double getRadius()
static SUMOTime getBegin()
static bool useGeo()
static double getMaxLeaderDistance()
static bool skipEmpty()
static void initOnce()
initialize edge filter and attribute mask (once)
static bool hasShapeFilter()
is there a filter based on shapes?
static bool useUTM()
static bool shapeFilter(const SUMOTrafficObject *veh)
checks if in polygon
static const SumoXMLAttrMask & getWrittenAttributes()
static const std::vector< std::string > & getParamsToWrite()
const MSEdgeVector & getEdges() const
Returns loaded edges.
A road/street connecting two junctions.
Definition MSEdge.h:77
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition MSEdge.h:168
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
Definition MSEdge.cpp:1192
double getDistanceAt(double pos) const
Returns the kilometrage/mileage at the given offset along the edge.
Definition MSEdge.cpp:1698
static void writeEmissions(OutputDevice &of, const MSBaseVehicle *const veh, const bool includeType, const SumoXMLAttrMask &mask)
Writes emission values for a single vehicle into the given device.
static void write(OutputDevice &of, const SUMOTime timestep, const SumoXMLTag tag=SUMO_TAG_NOTHING)
Writes the position and the angle of each vehicle into the given device.
static bool isVisible(const SUMOVehicle *veh)
static void writeTransportable(OutputDevice &of, const MSEdge *const e, const MSTransportable *const p, const SUMOVehicle *const v, const SumoXMLTag tag, const bool useGeo, const SumoXMLAttrMask mask)
write transportable
static bool hasOwnOutput(const SUMOVehicle *veh, bool filter, bool shapeFilter, bool isInRadius=false)
static bool gUseMesoSim
Definition MSGlobals.h:106
bool isInternal() const
Definition MSLane.cpp:2652
MSEdge & getEdge() const
Returns the lane's edge.
Definition MSLane.h:775
The simulated network and simulation perfomer.
Definition MSNet.h:89
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition MSNet.cpp:199
virtual MSTransportableControl & getContainerControl()
Returns the container control.
Definition MSNet.cpp:1300
bool hasContainers() const
Returns whether containers are simulated.
Definition MSNet.h:435
bool hasPersons() const
Returns whether persons are simulated.
Definition MSNet.h:419
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition MSNet.h:402
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition MSNet.cpp:1291
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition MSNet.h:445
double getDistanceBetween(double fromPos, double toPos, const MSLane *fromLane, const MSLane *toLane, int routePosition=0) const
Compute the distance between 2 given edges on this route, optionally including the length of internal...
Definition MSRoute.cpp:318
bool hasTransportables() const
checks whether any transportable waits to finish her plan
A device which collects info on the vehicle trip (mainly on departure and arrival)
Position getPosition(const double) const override
Return current position (x/y, cartesian)
virtual double getEdgePos() const
Return the position on the edge.
virtual double getSpeed() const override
the current speed of the transportable
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
MSDevice * getDevice(const std::type_info &type) const override
Returns a device of the given type if it exists or nullptr if not.
const MSVehicleType & getVehicleType() const override
Returns the object's "vehicle" type.
virtual double getAngle() const override
return the current angle of the transportable
const MSEdge * getEdge() const override
Returns the current edge.
The class responsible for building and deletion of vehicles.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
MSAbstractLaneChangeModel & getLaneChangeModel()
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
Definition MSVehicle.h:514
int getSignals() const
Returns the signals.
Definition MSVehicle.h:1185
const MSLane * getLane() const
Returns the lane the vehicle is on.
Definition MSVehicle.h:581
double getSpeed() const
Returns the vehicle's current speed.
Definition MSVehicle.h:490
double getAngle() const
Returns the vehicle's direction in radians.
Definition MSVehicle.h:735
std::pair< const MSVehicle *const, double > getLeader(double dist=0, bool considerFoes=true) const
Returns the leader of the vehicle looking for a fixed distance.
const std::string & getID() const
Returns the name of the vehicle type.
double getMinGap() const
Get the free space in front of vehicles of this class.
const std::string & getID() const
Returns the id.
Definition Named.h:73
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
OutputDevice & writeOptionalAttr(const SumoXMLAttr attr, const T &val, const SumoXMLAttrMask &attributeMask, const bool isNull=false)
writes a named attribute unless filtered
OutputDevice & writeFuncAttr(const SumoXMLAttr attr, const Func &valFunc, const SumoXMLAttrMask &attributeMask, const bool isNull=false)
OutputDevice & writeTime(const SumoXMLAttr attr, const SUMOTime val)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
void sub(double dx, double dy)
Subtracts the given position from this one.
Definition Position.h:149
double x() const
Returns the x-position.
Definition Position.h:52
double z() const
Returns the z-position.
Definition Position.h:62
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual double getSlope() const =0
Returns the slope of the road at object's position in degrees.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual MSDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or nullptr if not.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
virtual const MSEdge * getEdge() const =0
Returns the (normal) route edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
Definition SUMOVehicle.h:63
virtual const std::vector< MSTransportable * > & getContainers() const =0
retrieve riding containers
virtual double getLateralPositionOnLane() const =0
Get the vehicle's lateral position on the lane.
virtual int getPersonNumber() const =0
Returns the number of persons.
virtual double getOdometer() const =0
Returns the distance that was already driven by this vehicle.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
virtual int getContainerNumber() const =0
Returns the number of containers.
virtual bool isRemoteControlled() const =0
Returns the information whether the vehicle is fully controlled via TraCI.
virtual const MSEdge * getCurrentEdge() const =0
virtual double getAngle() const =0
Get the vehicle's angle.
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
static void collectObjectsInRange(int domain, const PositionVector &shape, double range, std::set< const Named * > &into)
Definition Helper.cpp:837
TRACI_CONST int CMD_GET_VEHICLE_VARIABLE
TRACI_CONST int CMD_GET_PERSON_VARIABLE