Eclipse SUMO - Simulation of Urban MObility
ROPerson.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // A vehicle as used by router
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <iostream>
29 #include <utils/common/ToString.h>
36 #include "RORouteDef.h"
37 #include "RORoute.h"
38 #include "ROVehicle.h"
39 #include "ROHelper.h"
40 #include "RONet.h"
41 #include "ROLane.h"
42 #include "ROPerson.h"
43 
44 
45 // ===========================================================================
46 // method definitions
47 // ===========================================================================
49  : RORoutable(pars, type) {
50 }
51 
52 
54  for (std::vector<PlanItem*>::const_iterator it = myPlan.begin(); it != myPlan.end(); ++it) {
55  delete *it;
56  }
57 }
58 
59 
60 void
61 ROPerson::addTrip(const ROEdge* const from, const ROEdge* const to, const SVCPermissions modeSet,
62  const std::string& vTypes, const double departPos, const double arrivalPos, const std::string& busStop, double walkFactor) {
63  PersonTrip* trip = new PersonTrip(from, to, modeSet, departPos, arrivalPos, busStop, walkFactor);
64  RONet* net = RONet::getInstance();
67  if (departPos != 0) {
69  pars.departPos = departPos;
71  }
72  for (StringTokenizer st(vTypes); st.hasNext();) {
73  pars.vtypeid = st.next();
76  if (type == nullptr) {
77  delete trip;
78  throw InvalidArgument("The vehicle type '" + pars.vtypeid + "' in a trip for person '" + getID() + "' is not known.");
79  }
80  pars.id = getID() + "_" + toString(trip->getVehicles().size());
81  trip->addVehicle(new ROVehicle(pars, new RORouteDef("!" + pars.id, 0, false, false), type, net));
82  }
83  if (trip->getVehicles().empty()) {
84  if ((modeSet & SVC_PASSENGER) != 0) {
85  pars.id = getID() + "_0";
86  trip->addVehicle(new ROVehicle(pars, new RORouteDef("!" + pars.id, 0, false, false), net->getVehicleTypeSecure(DEFAULT_VTYPE_ID), net));
87  }
88  if ((modeSet & SVC_BICYCLE) != 0) {
89  pars.id = getID() + "_b0";
92  trip->addVehicle(new ROVehicle(pars, new RORouteDef("!" + pars.id, 0, false, false), net->getVehicleTypeSecure(DEFAULT_BIKETYPE_ID), net));
93  }
94  }
95  myPlan.push_back(trip);
96 }
97 
98 
99 void
100 ROPerson::addRide(const ROEdge* const from, const ROEdge* const to, const std::string& lines, double arrivalPos, const std::string& destStop) {
101  if (myPlan.empty() || myPlan.back()->isStop()) {
102  myPlan.push_back(new PersonTrip());
103  }
104  myPlan.back()->addTripItem(new Ride(from, to, lines, -1., arrivalPos, destStop));
105 }
106 
107 
108 void
109 ROPerson::addWalk(const ConstROEdgeVector& edges, const double duration, const double speed, const double departPos, const double arrivalPos, const std::string& busStop) {
110  if (myPlan.empty() || myPlan.back()->isStop()) {
111  myPlan.push_back(new PersonTrip());
112  }
113  myPlan.back()->addTripItem(new Walk(edges, -1., duration, speed, departPos, arrivalPos, busStop));
114 }
115 
116 
117 void
118 ROPerson::addStop(const SUMOVehicleParameter::Stop& stopPar, const ROEdge* const stopEdge) {
119  myPlan.push_back(new Stop(stopPar, stopEdge));
120 }
121 
122 
123 void
124 ROPerson::Ride::saveAsXML(OutputDevice& os, const bool extended) const {
126  std::string comment = "";
127  if (extended && cost >= 0.) {
129  }
130  if (from != nullptr) {
132  }
133  if (to != nullptr) {
134  os.writeAttr(SUMO_ATTR_TO, to->getID());
135  }
136  if (destStop != "") {
138  const std::string name = RONet::getInstance()->getStoppingPlaceName(destStop);
139  if (name != "") {
140  comment = " <!-- " + name + " -->";
141  }
142  }
144  if (intended != "" && intended != lines) {
146  }
147  if (depart >= 0) {
149  }
150  os.closeTag(comment);
151 }
152 
153 
154 void
155 ROPerson::Walk::saveAsXML(OutputDevice& os, const bool extended) const {
157  std::string comment = "";
158  if (extended && cost >= 0.) {
159  os.writeAttr(SUMO_ATTR_COST, cost);
160  }
161  if (dur > 0) {
162  os.writeAttr(SUMO_ATTR_DURATION, dur);
163  }
164  if (v > 0) {
165  os.writeAttr(SUMO_ATTR_SPEED, v);
166  }
167  os.writeAttr(SUMO_ATTR_EDGES, edges);
168  if (arr != 0. && destStop == "") {
170  }
171  if (destStop != "") {
172  os.writeAttr(SUMO_ATTR_BUS_STOP, destStop);
173  const std::string name = RONet::getInstance()->getStoppingPlaceName(destStop);
174  if (name != "") {
175  comment = " <!-- " + name + " -->";
176  }
177  }
178  os.closeTag(comment);
179 }
180 
183  PersonTrip* result = new PersonTrip(from, to, modes, dep, arr, stopDest, walkFactor);
184  for (auto* item : myTripItems) {
185  result->myTripItems.push_back(item->clone());
186  }
187  return result;
188 }
189 
190 void
191 ROPerson::PersonTrip::saveVehicles(OutputDevice& os, OutputDevice* const typeos, bool asAlternatives, OptionsCont& options) const {
192  for (std::vector<ROVehicle*>::const_iterator it = myVehicles.begin(); it != myVehicles.end(); ++it) {
193  (*it)->saveAsXML(os, typeos, asAlternatives, options);
194  }
195 }
196 
197 void
198 ROPerson::PersonTrip::saveAsXML(OutputDevice& os, const bool extended, const bool asTrip, const bool writeGeoTrip) const {
199  if (asTrip) {
201  if (writeGeoTrip) {
202  Position fromPos = from->getLanes()[0]->getShape().positionAtOffset2D(getDepartPos());
203  if (GeoConvHelper::getFinal().usingGeoProjection()) {
206  os.writeAttr(SUMO_ATTR_FROMLONLAT, fromPos);
208  } else {
209  os.writeAttr(SUMO_ATTR_FROMXY, fromPos);
210  }
211  } else {
212  os.writeAttr(SUMO_ATTR_FROM, from->getID());
213  }
214  if (writeGeoTrip) {
215  Position toPos = to->getLanes()[0]->getShape().positionAtOffset2D(MIN2(getArrivalPos(), to->getLanes()[0]->getShape().length2D()));
216  if (GeoConvHelper::getFinal().usingGeoProjection()) {
219  os.writeAttr(SUMO_ATTR_TOLONLAT, toPos);
221  } else {
222  os.writeAttr(SUMO_ATTR_TOXY, toPos);
223  }
224  } else {
225  os.writeAttr(SUMO_ATTR_TO, to->getID());
226  }
227  std::vector<std::string> allowedModes;
228  if ((modes & SVC_BUS) != 0) {
229  allowedModes.push_back("public");
230  }
231  if ((modes & SVC_PASSENGER) != 0) {
232  allowedModes.push_back("car");
233  }
234  if ((modes & SVC_BICYCLE) != 0) {
235  allowedModes.push_back("bicycle");
236  }
237  if (allowedModes.size() > 0) {
238  os.writeAttr(SUMO_ATTR_MODES, toString(allowedModes));
239  }
240  if (!writeGeoTrip) {
241  if (dep != 0 && dep != std::numeric_limits<double>::infinity()) {
243  }
244  if (arr != 0 && arr != std::numeric_limits<double>::infinity()) {
246  }
247  }
248  if (getStopDest() != "") {
249  os.writeAttr(SUMO_ATTR_BUS_STOP, getStopDest());
250  }
251  if (walkFactor != 1) {
252  os.writeAttr(SUMO_ATTR_WALKFACTOR, walkFactor);
253  }
254  os.closeTag();
255  } else {
256  for (std::vector<TripItem*>::const_iterator it = myTripItems.begin(); it != myTripItems.end(); ++it) {
257  (*it)->saveAsXML(os, extended);
258  }
259  }
260 }
261 
262 SUMOTime
264  SUMOTime result = 0;
265  for (TripItem* tItem : myTripItems) {
266  result += tItem->getDuration();
267  }
268  return result;
269 }
270 
271 bool
273  PersonTrip* const trip, const ROVehicle* const veh, MsgHandler* const errorHandler) {
274  std::vector<ROIntermodalRouter::TripItem> result;
275  provider.getIntermodalRouter().compute(trip->getOrigin(), trip->getDestination(), trip->getDepartPos(), trip->getArrivalPos(), trip->getStopDest(),
276  getType()->maxSpeed * trip->getWalkFactor(), veh, trip->getModes(), time, result);
277  bool carUsed = false;
278  for (std::vector<ROIntermodalRouter::TripItem>::const_iterator it = result.begin(); it != result.end(); ++it) {
279  if (!it->edges.empty()) {
280  if (it->line == "") {
281  if (it + 1 == result.end() && trip->getStopDest() == "") {
282  trip->addTripItem(new Walk(it->edges, it->cost, trip->getDepartPos(false), trip->getArrivalPos(false)));
283  } else {
284  trip->addTripItem(new Walk(it->edges, it->cost, trip->getDepartPos(false), trip->getArrivalPos(false), it->destStop));
285  }
286  } else if (veh != nullptr && it->line == veh->getID()) {
287  trip->addTripItem(new Ride(it->edges.front(), it->edges.back(), veh->getID(), it->cost, trip->getArrivalPos(), it->destStop));
288  veh->getRouteDefinition()->addLoadedAlternative(new RORoute(veh->getID() + "_RouteDef", it->edges));
289  carUsed = true;
290  } else {
291  trip->addTripItem(new Ride(nullptr, nullptr, it->line, it->cost, trip->getArrivalPos(), it->destStop, it->intended, TIME2STEPS(it->depart)));
292  }
293  }
294  }
295  if (result.empty()) {
296  errorHandler->inform("No route for trip in person '" + getID() + "'.");
297  myRoutingSuccess = false;
298  }
299  return carUsed;
300 }
301 
302 
303 void
305  const bool /* removeLoops */, MsgHandler* errorHandler) {
306  myRoutingSuccess = true;
307  SUMOTime time = getParameter().depart;
308  for (std::vector<PlanItem*>::iterator it = myPlan.begin(); it != myPlan.end(); ++it) {
309  if ((*it)->needsRouting()) {
310  PersonTrip* trip = static_cast<PersonTrip*>(*it);
311  std::vector<ROVehicle*>& vehicles = trip->getVehicles();
312  if (vehicles.empty()) {
313  computeIntermodal(time, provider, trip, nullptr, errorHandler);
314  } else {
315  for (std::vector<ROVehicle*>::iterator v = vehicles.begin(); v != vehicles.end();) {
316  if (!computeIntermodal(time, provider, trip, *v, errorHandler)) {
317  v = vehicles.erase(v);
318  } else {
319  ++v;
320  }
321  }
322  }
323  }
324  time += (*it)->getDuration();
325  }
326 }
327 
328 
329 void
330 ROPerson::saveAsXML(OutputDevice& os, OutputDevice* const typeos, bool asAlternatives, OptionsCont& options) const {
331  // write the person's vehicles
332  const bool writeTrip = options.exists("write-trips") && options.getBool("write-trips");
333  const bool writeGeoTrip = writeTrip && options.getBool("write-trips.geo");
334  if (!writeTrip) {
335  for (std::vector<PlanItem*>::const_iterator it = myPlan.begin(); it != myPlan.end(); ++it) {
336  (*it)->saveVehicles(os, typeos, asAlternatives, options);
337  }
338  }
339 
340  if (typeos != nullptr && getType() != nullptr && !getType()->saved) {
341  getType()->write(*typeos);
342  getType()->saved = true;
343  }
344  if (getType() != nullptr && !getType()->saved) {
345  getType()->write(os);
346  getType()->saved = asAlternatives;
347  }
348 
349  // write the person
350  getParameter().write(os, options, SUMO_TAG_PERSON);
351 
352  for (std::vector<PlanItem*>::const_iterator it = myPlan.begin(); it != myPlan.end(); ++it) {
353  (*it)->saveAsXML(os, asAlternatives, writeTrip, writeGeoTrip);
354  }
355 
356  // write params
358  os.closeTag();
359 }
360 
361 
362 /****************************************************************************/
363 
ROPerson::PersonTrip::saveAsXML
void saveAsXML(OutputDevice &os, const bool extended, const bool asTrip, const bool writeGeoTrip) const
Definition: ROPerson.cpp:198
RORoutable::myRoutingSuccess
bool myRoutingSuccess
Whether the last routing was successful.
Definition: RORoutable.h:181
ROPerson::Ride::lines
const std::string lines
Definition: ROPerson.h:207
ToString.h
ROPerson::Ride::intended
const std::string intended
Definition: ROPerson.h:209
SUMO_ATTR_DEPART
@ SUMO_ATTR_DEPART
Definition: SUMOXMLDefinitions.h:431
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:73
ROPerson::PersonTrip::addVehicle
void addVehicle(ROVehicle *veh)
Definition: ROPerson.h:287
SUMOVehicleParameter::parametersSet
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
Definition: SUMOVehicleParameter.h:671
SUMO_ATTR_TOLONLAT
@ SUMO_ATTR_TOLONLAT
Definition: SUMOXMLDefinitions.h:642
ROHelper.h
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
SUMO_ATTR_TOXY
@ SUMO_ATTR_TOXY
Definition: SUMOXMLDefinitions.h:644
OptionsCont.h
StringTokenizer::hasNext
bool hasNext()
returns the information whether further substrings exist
Definition: StringTokenizer.cpp:94
ROPerson::PersonTrip::saveVehicles
void saveVehicles(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
Definition: ROPerson.cpp:191
ROPerson::Ride
A ride is part of a trip, e.g., go from here to here by car or bus.
Definition: ROPerson.h:175
SUMOVehicleParameter::vtypeid
std::string vtypeid
The vehicle's type id.
Definition: SUMOVehicleParameter.h:474
SUMOVehicleParameter::departPosProcedure
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
Definition: SUMOVehicleParameter.h:497
MsgHandler.h
OutputDevice::setPrecision
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
Definition: OutputDevice.cpp:221
SUMO_TAG_PERSON
@ SUMO_TAG_PERSON
Definition: SUMOXMLDefinitions.h:295
MsgHandler::inform
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:118
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMO_TAG_PERSONTRIP
@ SUMO_TAG_PERSONTRIP
Definition: SUMOXMLDefinitions.h:296
ROPerson::saveAsXML
void saveAsXML(OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
Saves the complete person description.
Definition: ROPerson.cpp:330
SUMO_ATTR_LINES
@ SUMO_ATTR_LINES
Definition: SUMOXMLDefinitions.h:776
OptionsCont::exists
bool exists(const std::string &name) const
Returns the information whether the named option is known.
Definition: OptionsCont.cpp:129
GeoConvHelper.h
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
SVC_BICYCLE
@ SVC_BICYCLE
vehicle is a bicycle
Definition: SUMOVehicleClass.h:179
RORouteDef
Base class for a vehicle's route definition.
Definition: RORouteDef.h:55
SUMOVehicleParameter::departProcedure
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
Definition: SUMOVehicleParameter.h:485
SUMOVTypeParameter::saved
bool saved
Information whether this type was already saved (needed by routers)
Definition: SUMOVTypeParameter.h:310
RONet
The router's network representation.
Definition: RONet.h:63
SUMO_ATTR_SPEED
@ SUMO_ATTR_SPEED
Definition: SUMOXMLDefinitions.h:384
RORoutable::getType
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
Definition: RORoutable.h:84
SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_ARRIVALPOS
Definition: SUMOXMLDefinitions.h:437
ROVehicle
A vehicle as used by router.
Definition: ROVehicle.h:52
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
ROVehicle.h
RORouteDef.h
SUMO_ATTR_COST
@ SUMO_ATTR_COST
Definition: SUMOXMLDefinitions.h:627
RONet::getInstance
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
Definition: RONet.cpp:55
RORoute.h
SUMOVehicleParameter::depart
SUMOTime depart
Definition: SUMOVehicleParameter.h:482
gPrecisionGeo
int gPrecisionGeo
Definition: StdDefs.cpp:27
Parameterised::writeParams
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
Definition: Parameterised.cpp:154
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:253
SUMO_ATTR_TO
@ SUMO_ATTR_TO
Definition: SUMOXMLDefinitions.h:640
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:255
ROPerson::Walk
A walk is part of a trip, e.g., go from here to here by foot.
Definition: ROPerson.h:223
ROPerson::Ride::depart
const SUMOTime depart
Definition: ROPerson.h:210
SUMO_ATTR_FROMLONLAT
@ SUMO_ATTR_FROMLONLAT
Definition: SUMOXMLDefinitions.h:641
ROPerson::Ride::from
const ROEdge *const from
Definition: ROPerson.h:205
MsgHandler
Definition: MsgHandler.h:38
ROPerson::Walk::saveAsXML
void saveAsXML(OutputDevice &os, const bool extended) const
Definition: ROPerson.cpp:155
GeoConvHelper::getFinal
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Definition: GeoConvHelper.h:105
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
ROPerson::PlanItem
Every person has a plan comprising of multiple planItems.
Definition: ROPerson.h:79
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:58
ROPerson::Ride::to
const ROEdge *const to
Definition: ROPerson.h:206
SUMO_TAG_RIDE
@ SUMO_TAG_RIDE
Definition: SUMOXMLDefinitions.h:297
RONet.h
SUMOVTypeParameter
Structure representing possible vehicle parameter.
Definition: SUMOVTypeParameter.h:86
StringTokenizer
Definition: StringTokenizer.h:61
DEFAULT_VTYPE_ID
const std::string DEFAULT_VTYPE_ID
ROPerson::addStop
void addStop(const SUMOVehicleParameter::Stop &stopPar, const ROEdge *const stopEdge)
Definition: ROPerson.cpp:118
RORoutable::getParameter
const SUMOVehicleParameter & getParameter() const
Returns the definition of the vehicle / person parameter.
Definition: RORoutable.h:73
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
ROPerson::PersonTrip
A planItem can be a Trip which contains multiple tripItems.
Definition: ROPerson.h:264
SUMOVehicleParameter::id
std::string id
The vehicle's id.
Definition: SUMOVehicleParameter.h:468
SUMO_ATTR_EDGES
@ SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:427
ROPerson::addTrip
void addTrip(const ROEdge *const from, const ROEdge *const to, const SVCPermissions modeSet, const std::string &vTypes, const double departPos, const double arrivalPos, const std::string &busStop, double walkFactor)
Definition: ROPerson.cpp:61
RORoutable::getID
const std::string & getID() const
Returns the id of the routable.
Definition: RORoutable.h:93
OutputDevice.h
ROPerson::PersonTrip::getDepartPos
double getDepartPos(bool replaceDefault=true) const
Definition: ROPerson.h:306
ROVehicle::getRouteDefinition
RORouteDef * getRouteDefinition() const
Returns the definition of the route the vehicle takes.
Definition: ROVehicle.h:75
ROPerson::Stop
A planItem can be a Stop.
Definition: ROPerson.h:108
GeoConvHelper::cartesian2geo
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Definition: GeoConvHelper.cpp:293
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
ROPerson::PersonTrip::getDuration
SUMOTime getDuration() const
return duration sum of all trip items
Definition: ROPerson.cpp:263
ROPerson::PersonTrip::getVehicles
std::vector< ROVehicle * > & getVehicles()
Definition: ROPerson.h:290
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
RORoute
A complete router's route.
Definition: RORoute.h:54
ROPerson::computeRoute
void computeRoute(const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)
Definition: ROPerson.cpp:304
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
DEPART_TRIGGERED
@ DEPART_TRIGGERED
The departure is person triggered.
Definition: SUMOVehicleParameter.h:102
SUMO_ATTR_INTENDED
@ SUMO_ATTR_INTENDED
Definition: SUMOXMLDefinitions.h:778
ROPerson::PersonTrip::myTripItems
std::vector< TripItem * > myTripItems
the fully specified trips
Definition: ROPerson.h:338
RouterProvider
Definition: RouterProvider.h:37
ROPerson::TripItem::cost
double cost
Definition: ROPerson.h:168
ROPerson::addWalk
void addWalk(const ConstROEdgeVector &edges, const double duration, const double speed, const double departPos, const double arrivalPos, const std::string &busStop)
Definition: ROPerson.cpp:109
SUMOVTypeParameter::write
void write(OutputDevice &dev) const
Writes the vtype.
Definition: SUMOVTypeParameter.cpp:348
ROPerson.h
RORouteDef::addLoadedAlternative
void addLoadedAlternative(RORoute *alternative)
Adds a single alternative loaded from the file An alternative may also be generated during DUA.
Definition: RORouteDef.cpp:68
SUMO_ATTR_FROMXY
@ SUMO_ATTR_FROMXY
Definition: SUMOXMLDefinitions.h:643
ROPerson::myPlan
std::vector< PlanItem * > myPlan
The plan of the person.
Definition: ROPerson.h:388
SUMOVehicleParameter::write
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
Definition: SUMOVehicleParameter.cpp:67
SUMO_ATTR_FROM
@ SUMO_ATTR_FROM
Definition: SUMOXMLDefinitions.h:639
RORoutable
A routable thing such as a vehicle or person.
Definition: RORoutable.h:54
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:239
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
VEHPARS_VTYPE_SET
const int VEHPARS_VTYPE_SET
Definition: SUMOVehicleParameter.h:46
StringUtils.h
SUMO_ATTR_DURATION
@ SUMO_ATTR_DURATION
Definition: SUMOXMLDefinitions.h:667
ROPerson::~ROPerson
virtual ~ROPerson()
Destructor.
Definition: ROPerson.cpp:53
ROPerson::ROPerson
ROPerson(const SUMOVehicleParameter &pars, const SUMOVTypeParameter *type)
Constructor.
Definition: ROPerson.cpp:48
VEHPARS_DEPARTPOS_SET
const int VEHPARS_DEPARTPOS_SET
Definition: SUMOVehicleParameter.h:48
InvalidArgument
Definition: UtilExceptions.h:56
SUMO_TAG_WALK
@ SUMO_TAG_WALK
Definition: SUMOXMLDefinitions.h:298
ROPerson::PersonTrip::getStopDest
const std::string & getStopDest() const
Definition: ROPerson.h:315
RouterProvider::getIntermodalRouter
IntermodalRouter< E, L, N, V > & getIntermodalRouter() const
Definition: RouterProvider.h:57
ROPerson::addRide
void addRide(const ROEdge *const from, const ROEdge *const to, const std::string &lines, double arrivalPos, const std::string &destStop)
Definition: ROPerson.cpp:100
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
SUMO_ATTR_MODES
@ SUMO_ATTR_MODES
Definition: SUMOXMLDefinitions.h:653
config.h
ROLane.h
SVC_BUS
@ SVC_BUS
vehicle is a bus
Definition: SUMOVehicleClass.h:165
StringTokenizer.h
gPrecision
int gPrecision
the precision for floating point outputs
Definition: StdDefs.cpp:26
SUMO_ATTR_DEPARTPOS
@ SUMO_ATTR_DEPARTPOS
Definition: SUMOXMLDefinitions.h:433
ROPerson::Ride::saveAsXML
void saveAsXML(OutputDevice &os, const bool extended) const
Definition: ROPerson.cpp:124
ROPerson::computeIntermodal
bool computeIntermodal(SUMOTime time, const RORouterProvider &provider, PersonTrip *const trip, const ROVehicle *const veh, MsgHandler *const errorHandler)
Definition: ROPerson.cpp:272
DEPART_POS_GIVEN
@ DEPART_POS_GIVEN
The position is given.
Definition: SUMOVehicleParameter.h:144
RONet::getStoppingPlaceName
const std::string getStoppingPlaceName(const std::string &id) const
return the name for the given stopping place id
Definition: RONet.cpp:703
ROPerson::PersonTrip::getOrigin
const ROEdge * getOrigin() const
Definition: ROPerson.h:293
ROPerson::TripItem
A TripItem is part of a trip, e.g., go from here to here by car.
Definition: ROPerson.h:150
ROPerson::PersonTrip::clone
PlanItem * clone() const
Definition: ROPerson.cpp:182
ROPerson::PersonTrip::getDestination
const ROEdge * getDestination() const
Definition: ROPerson.h:296
ROPerson::PersonTrip::getWalkFactor
double getWalkFactor() const
Definition: ROPerson.h:324
SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_BUS_STOP
Definition: SUMOXMLDefinitions.h:769
ROPerson::PersonTrip::getModes
SVCPermissions getModes() const
Definition: ROPerson.h:312
RONet::getVehicleTypeSecure
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:278
DEFAULT_BIKETYPE_ID
const std::string DEFAULT_BIKETYPE_ID
SUMOVTypeParameter.h
ROPerson::PersonTrip::addTripItem
virtual void addTripItem(TripItem *tripIt)
Definition: ROPerson.h:284
SUMO_ATTR_WALKFACTOR
@ SUMO_ATTR_WALKFACTOR
Definition: SUMOXMLDefinitions.h:654
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
ROPerson::Ride::destStop
const std::string destStop
Definition: ROPerson.h:208
ROPerson::PersonTrip::getArrivalPos
double getArrivalPos(bool replaceDefault=true) const
Definition: ROPerson.h:309
SUMOVehicleParameter::departPos
double departPos
(optional) The position the vehicle shall depart from
Definition: SUMOVehicleParameter.h:494
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:572