Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROVehicle.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-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// A vehicle as used by router
22/****************************************************************************/
23#include <config.h>
24
25#include <string>
26#include <iostream>
34#include "RORouteDef.h"
35#include "RORoute.h"
36#include "ROHelper.h"
37#include "RONet.h"
38#include "ROLane.h"
39#include "ROVehicle.h"
40
41#define INVALID_STOP_POS -1
42
43// ===========================================================================
44// static members
45// ===========================================================================
46std::map<ConstROEdgeVector, std::string> ROVehicle::mySavedRoutes;
47
48// ===========================================================================
49// method definitions
50// ===========================================================================
52 RORouteDef* route, const SUMOVTypeParameter* type,
53 const RONet* net, MsgHandler* errorHandler):
54 RORoutable(pars, type),
55 myRoute(route),
56 myJumpTime(-1) {
57 getParameter().stops.clear();
58 if (route != nullptr && route->getFirstRoute() != nullptr) {
59 for (StopParVector::const_iterator s = route->getFirstRoute()->getStops().begin(); s != route->getFirstRoute()->getStops().end(); ++s) {
60 addStop(*s, net, errorHandler);
61 }
62 }
63 for (StopParVector::const_iterator s = pars.stops.begin(); s != pars.stops.end(); ++s) {
64 addStop(*s, net, errorHandler);
65 }
66}
67
68
69void
70ROVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, const RONet* net, MsgHandler* errorHandler) {
71 const ROEdge* stopEdge = net->getEdge(stopPar.edge);
72 assert(stopEdge != 0); // was checked when parsing the stop
73 if (stopEdge->prohibits(this)) {
74 if (errorHandler != nullptr) {
75 errorHandler->inform("Stop edge '" + stopEdge->getID() + "' does not allow vehicle '" + getID() + "'.");
76 }
77 return;
78 }
79 // where to insert the stop
80 StopParVector::iterator iter = getParameter().stops.begin();
81 if (stopPar.index == STOP_INDEX_END || stopPar.index >= static_cast<int>(getParameter().stops.size())) {
82 if (getParameter().stops.size() > 0) {
83 iter = getParameter().stops.end();
84 }
85 } else {
86 if (stopPar.index == STOP_INDEX_FIT) {
87 iter = getParameter().stops.end();
88 } else {
89 iter += stopPar.index;
90 }
91 }
92 getParameter().stops.insert(iter, stopPar);
93 if (stopPar.jump >= 0) {
94 if (stopEdge->isInternal()) {
95 if (errorHandler != nullptr) {
96 errorHandler->inform("Jumps are not supported from internal stop edge '" + stopEdge->getID() + "'.");
97 }
98 } else {
99 if (myJumpTime < 0) {
100 myJumpTime = 0;
101 }
102 myJumpTime += stopPar.jump;
103 }
104 }
105}
106
107
109
110
111const ROEdge*
115
116
117void
119 const bool removeLoops, MsgHandler* errorHandler) {
121 std::string noRouteMsg = "The vehicle '" + getID() + "' has no valid route.";
122 RORouteDef* const routeDef = getRouteDefinition();
123 // check if the route definition is valid
124 if (routeDef == nullptr) {
125 errorHandler->inform(noRouteMsg);
126 myRoutingSuccess = false;
127 return;
128 }
129 routeDef->validateAlternatives(this, errorHandler);
130 if (routeDef->getFirstRoute() == nullptr) {
131 // everything is invalid and no new routes will be computed
132 myRoutingSuccess = false;
133 return;
134 }
135 RORoute* current = routeDef->buildCurrentRoute(router, getDepartureTime(), *this);
136 if (current == nullptr || current->size() == 0) {
137 delete current;
138 if (current == nullptr || !routeDef->discardSilent()) {
139 errorHandler->inform(noRouteMsg);
140 }
141 myRoutingSuccess = false;
142 return;
143 }
144 // check whether we have to evaluate the route for not containing loops
145 if (removeLoops) {
150 ConstROEdgeVector mandatory;
151 for (auto m : getMandatoryEdges(requiredStart, requiredEnd)) {
152 mandatory.push_back(m.edge);
153 }
154 current->recheckForLoops(mandatory);
155 // check whether the route is still valid
156 if (current->size() == 0) {
157 delete current;
158 errorHandler->inform(noRouteMsg + " (after removing loops)");
159 myRoutingSuccess = false;
160 return;
161 }
162 }
164 double costs = router.recomputeCosts(current->getEdgeVector(), this, getDepartureTime());
165 if (costs > RONet::getInstance()->getMaxTraveltime()) {
166 errorHandler->inform(noRouteMsg + " (traveltime " + time2string(TIME2STEPS(costs)) + " exceeds max-traveltime)");
167 delete current;
168 myRoutingSuccess = false;
169 return;
170 }
171 }
172 // add built route
173 RORoute* replaced = routeDef->addAlternative(router, this, current, getDepartureTime(), errorHandler);
174 if (replaced != nullptr) {
175 if (getParameter().departEdge > 0) {
176 updateIndex(replaced, current, getParameterMutable().departEdge);
177 }
178 if (getParameter().arrivalEdge >= 0) {
179 updateIndex(replaced, current, getParameterMutable().arrivalEdge);
180 }
181 delete replaced;
182 }
183 myRoutingSuccess = true;
184}
185
186
187void
188ROVehicle::updateIndex(const RORoute* replaced, const RORoute* current, int& attr) {
189 const ConstROEdgeVector& oldRoute = replaced->getEdgeVector();
190 if ((int)oldRoute.size() > attr) {
191 const ROEdge* old = oldRoute[attr];
192 int skips = 0;
193 for (int i = 0; i < attr; i++) {
194 if (oldRoute[i] == old) {
195 skips++;
196 }
197 }
198 int i = 0;
199 for (const ROEdge* cand : current->getEdgeVector()) {
200 if (cand == old) {
201 if (skips > 0) {
202 skips--;
203 } else {
204 attr = i;
205 }
206 }
207 i++;
208 }
209 }
210}
211
212
213std::vector<ROVehicle::Mandatory>
214ROVehicle::getMandatoryEdges(const ROEdge* requiredStart, const ROEdge* requiredEnd) const {
215 const RONet* net = RONet::getInstance();
216 std::vector<Mandatory> mandatory;
217 if (requiredStart) {
218 double departPos = 0;
219 if (getParameter().departPosProcedure == DepartPosDefinition::GIVEN) {
220 departPos = SUMOVehicleParameter::interpretEdgePos(getParameter().departPos, requiredStart->getLength(), SUMO_ATTR_DEPARTPOS, "vehicle '" + getID() + "'");
221 }
222 mandatory.push_back(Mandatory(requiredStart, departPos));
223 }
224 if (getParameter().via.size() != 0) {
225 // via takes precedence over stop edges
226 for (const std::string& via : getParameter().via) {
227 mandatory.push_back(Mandatory(net->getEdge(via), INVALID_STOP_POS));
228 }
229 } else {
230 for (const auto& stop : getParameter().stops) {
231 const ROEdge* e = net->getEdge(stop.edge);
232 if (e->isInternal()) {
233 // the edges before and after the internal edge are mandatory
234 const ROEdge* before = e->getNormalBefore();
235 const ROEdge* after = e->getNormalAfter();
236 mandatory.push_back(Mandatory(before, INVALID_STOP_POS));
237 mandatory.push_back(Mandatory(after, INVALID_STOP_POS, stop.jump));
238 } else {
239 double endPos = SUMOVehicleParameter::interpretEdgePos(stop.endPos, e->getLength(), SUMO_ATTR_ENDPOS, "stop of vehicle '" + getID() + "' on edge '" + e->getID() + "'");
240 mandatory.push_back(Mandatory(e, endPos, stop.jump));
241 }
242 }
243 }
244 if (requiredEnd) {
245 double arrivalPos = INVALID_STOP_POS;
246 if (getParameter().arrivalPosProcedure == ArrivalPosDefinition::GIVEN) {
247 arrivalPos = SUMOVehicleParameter::interpretEdgePos(getParameter().arrivalPos, requiredEnd->getLength(), SUMO_ATTR_ARRIVALPOS, "vehicle '" + getID() + "'");
248 }
249 mandatory.push_back(Mandatory(requiredEnd, arrivalPos));
250 }
251 return mandatory;
252}
253
254
255void
256ROVehicle::saveAsXML(OutputDevice& os, OutputDevice* const typeos, bool asAlternatives, OptionsCont& options, int cloneIndex) const {
257 if (typeos != nullptr && getType() != nullptr && !getType()->saved) {
258 getType()->write(*typeos);
259 getType()->saved = true;
260 }
261 if (getType() != nullptr && !getType()->saved) {
262 getType()->write(os);
263 getType()->saved = asAlternatives;
264 }
265
266 const bool writeTrip = options.exists("write-trips") && options.getBool("write-trips");
267 const bool writeGeoTrip = writeTrip && options.getBool("write-trips.geo");
268 const bool writeJunctions = writeTrip && options.getBool("write-trips.junctions");
269 const bool writeNamedRoute = !asAlternatives && options.getBool("named-routes");
270 const bool writeCosts = options.exists("write-costs") && options.getBool("write-costs");
271 const bool writeExit = options.exists("exit-times") && options.getBool("exit-times");
272 const bool writeLength = options.exists("route-length") && options.getBool("route-length");
273 const bool writeFlow = options.exists("keep-flows") && options.getBool("keep-flows") && isPartOfFlow();
274
275 std::string routeID;
276 if (writeNamedRoute) {
278 auto it = mySavedRoutes.find(edges);
279 if (it == mySavedRoutes.end()) {
280 routeID = "r" + toString(mySavedRoutes.size());
281 myRoute->getUsedRoute()->writeXMLDefinition(os, this, writeCosts, false, writeExit,
282 writeLength, routeID);
283 mySavedRoutes[edges] = routeID;
284 } else {
285 routeID = it->second;
286 }
287 }
288 const SumoXMLTag tag = writeFlow ? SUMO_TAG_FLOW : (writeTrip ? SUMO_TAG_TRIP : SUMO_TAG_VEHICLE);
289 // write the vehicle (new style, with included routes)
290 if (cloneIndex == 0) {
291 getParameter().write(os, options, tag);
292 } else {
294 // @note id collisions may occur if scale-suffic occurs in other vehicle ids
295 p.id += options.getString("scale-suffix") + toString(cloneIndex);
296 p.write(os, options, tag);
297 }
298 // save the route
299 if (writeTrip) {
301 const ROEdge* from = nullptr;
302 const ROEdge* to = nullptr;
303 if (edges.size() > 0) {
304 if (edges.front()->isTazConnector()) {
305 if (edges.size() > 1) {
306 from = edges[1];
307 if (from->isTazConnector() && writeJunctions && edges.front()->getSuccessors().size() > 0) {
308 // routing was skipped
309 from = edges.front()->getSuccessors(getVClass()).front();
310 }
311 }
312 } else {
313 from = edges[0];
314 }
315 if (edges.back()->isTazConnector()) {
316 if (edges.size() > 1) {
317 to = edges[edges.size() - 2];
318 if (to->isTazConnector() && writeJunctions && edges.back()->getPredecessors().size() > 0) {
319 // routing was skipped
320 to = edges.back()->getPredecessors().front();
321 }
322 }
323 } else {
324 to = edges[edges.size() - 1];
325 }
326 }
327 if (from != nullptr) {
328 if (writeGeoTrip) {
329 Position fromPos = from->getLanes()[0]->getShape().positionAtOffset2D(0);
330 if (GeoConvHelper::getFinal().usingGeoProjection()) {
333 os.writeAttr(SUMO_ATTR_FROMLONLAT, fromPos);
335 } else {
336 os.writeAttr(SUMO_ATTR_FROMXY, fromPos);
337 }
338 } else if (writeJunctions) {
340 } else {
341 os.writeAttr(SUMO_ATTR_FROM, from->getID());
342 }
343 }
344 if (to != nullptr) {
345 if (writeGeoTrip) {
346 Position toPos = to->getLanes()[0]->getShape().positionAtOffset2D(to->getLanes()[0]->getShape().length2D());
347 if (GeoConvHelper::getFinal().usingGeoProjection()) {
350 os.writeAttr(SUMO_ATTR_TOLONLAT, toPos);
352 } else {
353 os.writeAttr(SUMO_ATTR_TOXY, toPos);
354 }
355 } else if (writeJunctions) {
357 } else {
358 os.writeAttr(SUMO_ATTR_TO, to->getID());
359 }
360 }
361 if (getParameter().via.size() > 0) {
362 std::vector<std::string> viaOut;
363 SumoXMLAttr viaAttr = (writeGeoTrip
365 : (writeJunctions ? SUMO_ATTR_VIAJUNCTIONS : SUMO_ATTR_VIA));
366 for (const std::string& viaID : getParameter().via) {
367 const ROEdge* viaEdge = RONet::getInstance()->getEdge(viaID);
368 if (viaEdge->isTazConnector()) {
369 if (viaEdge->getPredecessors().size() == 0) {
370 continue;
371 }
372 // XXX used edge that was used in route
373 viaEdge = viaEdge->getPredecessors().front();
374 }
375 assert(viaEdge != nullptr);
376 if (writeGeoTrip) {
377 Position viaPos = viaEdge->getLanes()[0]->getShape().positionAtOffset2D(viaEdge->getLanes()[0]->getShape().length2D() / 2);
378 if (GeoConvHelper::getFinal().usingGeoProjection()) {
380 viaOut.push_back(toString(viaPos, gPrecisionGeo));
381 } else {
382 viaOut.push_back(toString(viaPos, gPrecision));
383 }
384 } else if (writeJunctions) {
385 viaOut.push_back(viaEdge->getToJunction()->getID());
386 } else {
387 viaOut.push_back(viaEdge->getID());
388 }
389 }
390 os.writeAttr(viaAttr, viaOut);
391 }
392 } else if (writeNamedRoute) {
393 os.writeAttr(SUMO_ATTR_ROUTE, routeID);
394 } else {
395 myRoute->writeXMLDefinition(os, this, asAlternatives, writeExit, writeCosts, writeLength);
396 }
397 for (StopParVector::const_iterator stop = getParameter().stops.begin(); stop != getParameter().stops.end(); ++stop) {
398 stop->write(os);
399 }
401 os.closeTag();
402}
403
404
405/****************************************************************************/
std::vector< const ROEdge * > ConstROEdgeVector
Definition ROEdge.h:57
#define INVALID_STOP_POS
Definition ROVehicle.cpp:41
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
#define TIME2STEPS(x)
Definition SUMOTime.h:60
const int STOP_INDEX_END
@ GIVEN
The lane is given.
@ GIVEN
The position is given.
@ GIVEN
The arrival lane is given.
const int STOP_INDEX_FIT
@ GIVEN
The arrival position is given.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VEHICLE
description of a vehicle
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_TRIP
a single trip definition (used by router)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_FROM_JUNCTION
@ SUMO_ATTR_VIALONLAT
@ SUMO_ATTR_VIA
@ SUMO_ATTR_VIAXY
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_TO_JUNCTION
@ SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_TOLONLAT
@ SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_VIAJUNCTIONS
@ SUMO_ATTR_FROMXY
@ SUMO_ATTR_TOXY
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_FROMLONLAT
int gPrecision
the precision for floating point outputs
Definition StdDefs.cpp:27
int gPrecisionGeo
Definition StdDefs.cpp:29
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.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
const std::string & getID() const
Returns the id.
Definition Named.h:74
A storage for options typed value containers)
Definition OptionsCont.h:89
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool exists(const std::string &name) const
Returns the information whether the named option is known.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Static storage of an output device and its base (abstract) implementation.
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.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A basic edge for routing applications.
Definition ROEdge.h:73
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
Definition ROEdge.cpp:292
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
Definition ROEdge.cpp:304
const RONode * getToJunction() const
Definition ROEdge.h:550
bool isTazConnector() const
Definition ROEdge.h:174
const RONode * getFromJunction() const
Definition ROEdge.h:546
bool isInternal() const
return whether this edge is an internal edge
Definition ROEdge.h:160
bool prohibits(const ROVehicle *const vehicle, bool checkRestrictions=false) const
Returns whether this edge prohibits the given vehicle to pass it.
Definition ROEdge.h:269
const ROEdgeVector & getPredecessors() const
Returns the edge at the given position from the list of incoming edges.
Definition ROEdge.h:366
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition ROEdge.cpp:389
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
Definition ROEdge.h:558
double getLength() const
Returns the length of the edge.
Definition ROEdge.h:225
The router's network representation.
Definition RONet.h:63
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
Definition RONet.cpp:56
double getMaxTraveltime() const
Definition RONet.h:462
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
Definition RONet.h:179
A routable thing such as a vehicle or person.
Definition RORoutable.h:53
SUMOVehicleClass getVClass() const
Definition RORoutable.h:127
SUMOVehicleParameter & getParameterMutable()
Definition RORoutable.h:79
bool isPartOfFlow() const
Definition RORoutable.h:151
bool myRoutingSuccess
Whether the last routing was successful.
Definition RORoutable.h:214
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
Definition RORoutable.h:89
const std::string & getID() const
Returns the id of the routable.
Definition RORoutable.h:98
const SUMOVehicleParameter & getParameter() const
Returns the definition of the vehicle / person parameter.
Definition RORoutable.h:75
Base class for a vehicle's route definition.
Definition RORouteDef.h:53
RORoute * addAlternative(SUMOAbstractRouter< ROEdge, ROVehicle > &router, const ROVehicle *const, RORoute *current, SUMOTime begin, MsgHandler *errorHandler)
Adds an alternative to the list of routes and returns the route that was replaced or nullptr.
const RORoute * getFirstRoute() const
Definition RORouteDef.h:105
OutputDevice & writeXMLDefinition(OutputDevice &dev, const ROVehicle *const veh, bool asAlternatives, bool withExitTimes, bool withCost, bool withLength) const
Saves the built route / route alternatives.
RORoute * buildCurrentRoute(SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh) const
Triggers building of the complete route (via preComputeCurrentRoute) or returns precomputed route.
const RORoute * getUsedRoute() const
Definition RORouteDef.h:112
void validateAlternatives(const ROVehicle *veh, MsgHandler *errorHandler)
removes invalid alternatives and raise an error or warning
bool discardSilent() const
whether this route shall be silently discarded
Definition RORouteDef.h:144
A complete router's route.
Definition RORoute.h:52
OutputDevice & writeXMLDefinition(OutputDevice &dev, const ROVehicle *const veh, const bool withCosts, const bool asAlternatives, const bool withExitTimes, const bool withLength, const std::string &id="") const
Definition RORoute.cpp:132
const StopParVector & getStops() const
Returns the list of stops this route contains.
Definition RORoute.h:190
int size() const
Returns the number of edges in this route.
Definition RORoute.h:143
ConstROEdgeVector getNormalEdges() const
return edges that shall be written in the route definition
Definition RORoute.cpp:120
void recheckForLoops(const ConstROEdgeVector &mandatory)
Checks whether this route contains loops and removes such.
Definition RORoute.cpp:76
const ConstROEdgeVector & getEdgeVector() const
Returns the list of edges this route consists of.
Definition RORoute.h:152
const ROEdge * getFirst() const
Returns the first edge in the route.
Definition RORoute.h:91
static std::map< ConstROEdgeVector, std::string > mySavedRoutes
map of all routes that were already saved with a name
Definition ROVehicle.h:165
const ROEdge * getDepartEdge() const
Returns the first edge the vehicle takes.
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at, 0 for triggered vehicles.
Definition ROVehicle.h:93
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition ROVehicle.h:74
void saveAsXML(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options, int cloneIndex=0) const
Saves the complete vehicle description.
ROVehicle(const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net, MsgHandler *errorHandler=0)
Constructor.
Definition ROVehicle.cpp:51
virtual ~ROVehicle()
Destructor.
SUMOTime myJumpTime
Whether this vehicle has any jumps defined.
Definition ROVehicle.h:162
std::vector< Mandatory > getMandatoryEdges(const ROEdge *requiredStart, const ROEdge *requiredEnd) const
void updateIndex(const RORoute *replaced, const RORoute *current, int &attr)
update departEdge / arrivalEdge
void addStop(const SUMOVehicleParameter::Stop &stopPar, const RONet *net, MsgHandler *errorHandler)
Adds a stop to this vehicle.
Definition ROVehicle.cpp:70
void computeRoute(const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)
RORouteDef *const myRoute
The route the vehicle takes.
Definition ROVehicle.h:159
SUMOAbstractRouter< E, V > & getVehicleRouter(SUMOVehicleClass svc) const
virtual double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Structure representing possible vehicle parameter.
void write(OutputDevice &dev) const
Writes the vtype.
bool saved
Information whether this type was already saved (needed by routers)
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at.
int index
at which position in the stops list
SUMOTime jump
transfer time if there shall be a jump from this stop to the next route edge
Structure representing possible vehicle parameter.
std::vector< std::string > via
List of the via-edges the vehicle must visit.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag altTag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
std::string id
The vehicle's id.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
int departEdge
(optional) The initial edge within the route of the vehicle
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id, bool silent=false)
Interprets negative edge positions and fits them onto a given edge.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
information for mandatory edges
Definition ROVehicle.h:99