Eclipse SUMO - Simulation of Urban MObility
MSStageTrip.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2023 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// An intermodal routing request (to be transformed into a sequence of walks and rides)
22/****************************************************************************/
23#include <config.h>
24
31#include <microsim/MSEdge.h>
32#include <microsim/MSLane.h>
33#include <microsim/MSNet.h>
41
42
43// ===========================================================================
44// method definitions
45// ===========================================================================
46
47/* -------------------------------------------------------------------------
48* MSStageTrip - methods
49* ----------------------------------------------------------------------- */
51 const MSEdge* destination, MSStoppingPlace* toStop,
52 const SUMOTime duration, const SVCPermissions modeSet,
53 const std::string& vTypes, const double speed, const double walkFactor,
54 const std::string& group,
55 const double departPosLat, const bool hasArrivalPos, const double arrivalPos):
56 MSStage(destination, toStop, arrivalPos, MSStageType::TRIP, group),
57 myOrigin(origin),
58 myOriginStop(fromStop),
59 myDuration(duration),
60 myModeSet(modeSet),
61 myVTypes(vTypes),
62 mySpeed(speed),
63 myWalkFactor(walkFactor),
64 myDepartPosLat(departPosLat),
65 myHaveArrivalPos(hasArrivalPos) {
66}
67
68
70
73 return new MSStageTrip(myOrigin, const_cast<MSStoppingPlace*>(myOriginStop),
76}
77
78
81 // may be called concurrently while the trip is still being routed
83}
84
85
86double
88 // may be called concurrently while the trip is still being routed
89 return getEdgeAngle(myOrigin, myDepartPos) + M_PI / 2 * (MSGlobals::gLefthand ? -1 : 1);
90}
91
92
93const MSEdge*
95 return myOrigin;
96}
97
98
99double
101 return myDepartPos;
102}
103
104
105const std::string
106MSStageTrip::setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now, const bool vehicleArrived) {
107 MSStage::setArrived(net, transportable, now, vehicleArrived);
108 if (myOrigin->isTazConnector() && myOrigin->getSuccessors().size() == 0) {
109 // previous stage ended at a taz sink-edge
110 myOrigin = transportable->getNextStage(-1)->getDestination();
111 }
112 MSVehicleControl& vehControl = net->getVehicleControl();
113 std::vector<SUMOVehicleParameter*> pars;
114 for (StringTokenizer st(myVTypes); st.hasNext();) {
115 pars.push_back(new SUMOVehicleParameter());
116 pars.back()->vtypeid = st.next();
117 pars.back()->parametersSet |= VEHPARS_VTYPE_SET;
118 pars.back()->departProcedure = DepartDefinition::TRIGGERED;
119 pars.back()->id = transportable->getID() + "_" + toString(pars.size() - 1);
120 }
121 if (pars.empty()) {
122 if ((myModeSet & SVC_PASSENGER) != 0) {
123 pars.push_back(new SUMOVehicleParameter());
124 pars.back()->id = transportable->getID() + "_0";
125 pars.back()->departProcedure = DepartDefinition::TRIGGERED;
126 } else if ((myModeSet & SVC_TAXI) != 0) {
127 pars.push_back(new SUMOVehicleParameter());
128 pars.back()->vtypeid = DEFAULT_TAXITYPE_ID;
129 pars.back()->id = transportable->getID() + "_taxi";
130 pars.back()->line = "taxi";
131 } else if ((myModeSet & SVC_BICYCLE) != 0) {
132 pars.push_back(new SUMOVehicleParameter());
133 pars.back()->vtypeid = DEFAULT_BIKETYPE_ID;
134 pars.back()->id = transportable->getID() + "_b0";
135 pars.back()->departProcedure = DepartDefinition::TRIGGERED;
136 } else {
137 // allow shortcut via busStop even when not intending to ride
138 pars.push_back(nullptr);
139 }
140 }
141 MSStage* previous;
143 if (transportable->getNumStages() == transportable->getNumRemainingStages()) { // this is a difficult way to check that we are the first stage
144 myDepartPos = transportable->getParameter().departPos;
147 }
148 previous = new MSStageWaiting(myOrigin, nullptr, -1, transportable->getParameter().depart, myDepartPos, "start", true);
149 time = transportable->getParameter().depart;
150 } else {
151 previous = transportable->getNextStage(-1);
152 myDepartPos = previous->getArrivalPos();
153 }
154 // TODO This works currently only for a single vehicle type
155 const int oldNumStages = transportable->getNumStages();
156 for (SUMOVehicleParameter* vehPar : pars) {
157 SUMOVehicle* vehicle = nullptr;
158 bool isTaxi = false;
159 if (vehPar != nullptr) {
160 isTaxi = vehPar->vtypeid == DEFAULT_TAXITYPE_ID && vehPar->line == "taxi";
161 if (myDepartPos != 0) {
162 vehPar->departPosProcedure = DepartPosDefinition::GIVEN;
163 vehPar->departPos = myDepartPos;
164 vehPar->parametersSet |= VEHPARS_DEPARTPOS_SET;
165 }
166 pars.back()->parametersSet |= VEHPARS_ARRIVALPOS_SET;
167 pars.back()->arrivalPosProcedure = ArrivalPosDefinition::GIVEN;
168 pars.back()->parametersSet |= VEHPARS_ARRIVALSPEED_SET;
169 pars.back()->arrivalSpeedProcedure = ArrivalSpeedDefinition::GIVEN;
170 pars.back()->arrivalSpeed = 0;
171
172 MSVehicleType* type = vehControl.getVType(vehPar->vtypeid);
173 if (type->getVehicleClass() != SVC_IGNORING && (myOrigin->getPermissions() & type->getVehicleClass()) == 0 && !isTaxi) {
174 WRITE_WARNINGF(TL("Ignoring vehicle type '%' when routing person '%' because it is not allowed on the start edge."), type->getID(), transportable->getID());
175 delete vehPar;
176 } else {
177 ConstMSRoutePtr const routeDummy = std::make_shared<MSRoute>(vehPar->id, ConstMSEdgeVector({ myOrigin }), false, nullptr, std::vector<SUMOVehicleParameter::Stop>());
178 vehicle = vehControl.buildVehicle(vehPar, routeDummy, type, !MSGlobals::gCheckRoutes);
179 }
180 }
181 bool carUsed = false;
182 std::vector<MSNet::MSIntermodalRouter::TripItem> result;
183 int stageIndex = 1;
184 double departPos = previous->getArrivalPos();
185 MSStoppingPlace* const prevStop = previous->getDestinationStop();
186 if (MSGlobals::gUseMesoSim && prevStop != nullptr) {
187 departPos = (prevStop->getBeginLanePosition() + prevStop->getEndLanePosition()) / 2.;
188 }
190 departPos, myOriginStop == nullptr ? "" : myOriginStop->getID(),
192 transportable->getMaxSpeed() * myWalkFactor, vehicle, myModeSet, time, result)) {
193 for (std::vector<MSNet::MSIntermodalRouter::TripItem>::iterator it = result.begin(); it != result.end(); ++it) {
194 if (!it->edges.empty()) {
196 double localArrivalPos = bs != nullptr ? bs->getAccessPos(it->edges.back()) : it->edges.back()->getLength() / 2.;
197 const MSEdge* const rideOrigin = myOrigin->isTazConnector() && (transportable->getNumStages() == oldNumStages) ? it->edges.front() : nullptr;
198 if (it + 1 == result.end() && myHaveArrivalPos) {
199 localArrivalPos = myArrivalPos;
200 }
201 if (it->line == "") {
202 // determine walk departPos
203 double depPos = previous->getArrivalPos();
204 if (previous->getDestinationStop() != nullptr) {
205 depPos = previous->getDestinationStop()->getAccessPos(it->edges.front());
206 } else if (myOrigin->isTazConnector()) {
207 // walk the whole length of the first edge
208 const MSEdge* first = it->edges.front();
209 if (std::find(first->getPredecessors().begin(), first->getPredecessors().end(), myOrigin) != first->getPredecessors().end()) {
210 depPos = 0;
211 } else {
212 depPos = first->getLength();
213 }
214 } else if (previous->getDestination() != it->edges.front()) {
215 if ((previous->getDestination()->getToJunction() == it->edges.front()->getToJunction())
216 || (previous->getDestination()->getFromJunction() == it->edges.front()->getToJunction())) {
217 depPos = it->edges.front()->getLength();
218 } else {
219 depPos = 0.;
220 }
221 }
223 // walk the whole length of the last edge
224 const MSEdge* last = it->edges.back();
225 if (std::find(last->getSuccessors().begin(), last->getSuccessors().end(), myDestination) != last->getSuccessors().end()) {
226 localArrivalPos = last->getLength();
227 } else {
228 localArrivalPos = 0;
229 }
230 }
231 previous = new MSPerson::MSPersonStage_Walking(transportable->getID(), it->edges, bs, myDuration, mySpeed, depPos, localArrivalPos, myDepartPosLat);
232 transportable->appendStage(previous, stageIndex++);
233 } else if (isTaxi) {
234 const ConstMSEdgeVector& prevEdges = previous->getEdges();
235 if (prevEdges.size() >= 2 && previous->getDestinationStop() == nullptr) {
236 // determine walking direction and let the previous
237 // stage end after entering its final edge
238 const MSEdge* last = prevEdges.back();
239 const MSEdge* prev = prevEdges[prevEdges.size() - 2];
240 if (last->getFromJunction() == prev->getToJunction() || prev->getFromJunction() == last->getFromJunction()) {
241 previous->setArrivalPos(MIN2(last->getLength(), 10.0));
242 } else {
243 previous->setArrivalPos(MAX2(0.0, last->getLength() - 10));
244 }
245 }
246 previous = new MSStageDriving(rideOrigin, it->edges.back(), bs, localArrivalPos, std::vector<std::string>({ "taxi" }), myGroup);
247 transportable->appendStage(previous, stageIndex++);
248 } else if (vehicle != nullptr && it->line == vehicle->getID()) {
249 if (bs == nullptr && it + 1 != result.end()) {
250 // we have no defined endpoint and are in the middle of the trip, drive as far as possible
251 localArrivalPos = it->edges.back()->getLength();
252 }
253 previous = new MSStageDriving(rideOrigin, it->edges.back(), bs, localArrivalPos, std::vector<std::string>({ it->line }));
254 transportable->appendStage(previous, stageIndex++);
255 vehicle->replaceRouteEdges(it->edges, -1, 0, "person:" + transportable->getID(), true);
256 vehicle->setArrivalPos(localArrivalPos);
257 const_cast<SUMOVehicleParameter&>(vehicle->getParameter()).arrivalPos = localArrivalPos;
258 vehControl.addVehicle(vehPar->id, vehicle);
259 carUsed = true;
260 } else {
261 previous = new MSStageDriving(rideOrigin, it->edges.back(), bs, localArrivalPos, std::vector<std::string>({ it->line }), myGroup, it->intended, TIME2STEPS(it->depart));
262 transportable->appendStage(previous, stageIndex++);
263 }
264 }
265 }
266 if (wasSet(VEHPARS_ARRIVALPOS_SET) && stageIndex > 1) {
267 // mark the last stage
268 transportable->getNextStage(stageIndex - 1)->markSet(VEHPARS_ARRIVALPOS_SET);
269 }
270 } else {
271 // append stage so the GUI won't crash due to inconsistent state
273 if (MSGlobals::gCheckRoutes) { // if not pedestrians will teleport
274 if (vehicle != nullptr) {
275 vehControl.deleteVehicle(vehicle, true);
276 }
277 return "No connection found between edge '" + myOrigin->getID() + "' and edge '" + (myDestinationStop != nullptr ? myDestinationStop->getID() : myDestination->getID()) + "' for person '" + transportable->getID() + "'.";
278 }
279 }
280 if (vehicle != nullptr && (isTaxi || !carUsed)) {
281 vehControl.deleteVehicle(vehicle, true);
282 }
283 }
284 if (transportable->getNumStages() == oldNumStages) {
285 // append stage so the GUI won't crash due to inconsistent state
287 if (MSGlobals::gCheckRoutes) { // if not pedestrians will teleport
288 return "Empty route between edge '" + myOrigin->getID() + "' and edge '" + (myDestinationStop != nullptr ? myDestinationStop->getID() : myDestination->getID()) + "' for person '" + transportable->getID() + "'.";
289 }
290 }
291 return "";
292}
293
294
295void
296MSStageTrip::proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* /* previous */) {
297 // just skip the stage, every interesting happens in setArrived
298 transportable->proceed(net, now);
299}
300
301
302std::string
304 return "trip from '" + myOrigin->getID() + "' to '" + getDestination()->getID() + "'";
305}
306
307void
308MSStageTrip::routeOutput(const bool /*isPerson*/, OutputDevice& os, const bool /*withRouteLength*/, const MSStage* const previous) const {
309 if (myArrived < 0) {
310 const bool walkFactorSet = myWalkFactor != OptionsCont::getOptions().getFloat("persontrip.walkfactor");
311 const bool groupSet = myGroup != OptionsCont::getOptions().getString("persontrip.default.group");
312 // could still be a persontrip but most likely it was a walk in the input
313 SumoXMLTag tag = myModeSet == 0 && !walkFactorSet && !groupSet ? SUMO_TAG_WALK : SUMO_TAG_PERSONTRIP;
314 os.openTag(tag);
315 if (previous == nullptr || previous->getStageType() == MSStageType::WAITING_FOR_DEPART) {
317 }
318 if (myDestinationStop == nullptr) {
322 }
323 } else {
325 }
326 std::vector<std::string> modes;
327 if ((myModeSet & SVC_PASSENGER) != 0) {
328 modes.push_back("car");
329 }
330 if ((myModeSet & SVC_BICYCLE) != 0) {
331 modes.push_back("bicycle");
332 }
333 if ((myModeSet & SVC_TAXI) != 0) {
334 modes.push_back("taxi");
335 }
336 if ((myModeSet & SVC_BUS) != 0) {
337 modes.push_back("public");
338 }
339 if (modes.size() > 0) {
340 os.writeAttr(SUMO_ATTR_MODES, modes);
341 }
342 if (myVTypes.size() > 0) {
344 }
345 if (groupSet) {
347 }
348 if (walkFactorSet) {
350 }
351 os.closeTag();
352 }
353}
354
355/****************************************************************************/
long long int SUMOTime
Definition: GUI.h:36
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:74
MSStageType
Definition: MSStage.h:54
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:268
#define TL(string)
Definition: MsgHandler.h:284
std::shared_ptr< const MSRoute > ConstMSRoutePtr
Definition: Route.h:32
#define TIME2STEPS(x)
Definition: SUMOTime.h:56
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
const std::string DEFAULT_TAXITYPE_ID
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const std::string DEFAULT_BIKETYPE_ID
@ GIVEN
The speed is given.
@ RANDOM
The position is set by the vehroute device.
@ GIVEN
The position is given.
const int VEHPARS_DEPARTPOS_SET
const int VEHPARS_ARRIVALSPEED_SET
@ GIVEN
The arrival position is given.
const int VEHPARS_VTYPE_SET
const int VEHPARS_ARRIVALPOS_SET
@ TRIGGERED
The departure is person triggered.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_WALK
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PERSONTRIP
@ SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_MODES
@ SUMO_ATTR_VTYPES
@ SUMO_ATTR_GROUP
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_WALKFACTOR
T MIN2(T a, T b)
Definition: StdDefs.h:76
T MAX2(T a, T b)
Definition: StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
bool compute(const E *from, const E *to, const double departPos, const std::string &originStopID, const double arrivalPos, const std::string &stopID, const double speed, const V *const vehicle, const SVCPermissions modeSet, const SUMOTime msTime, std::vector< TripItem > &into, const double externalFactor=0.)
Builds the route between the given edges using the minimum effort at the given time The definition of...
A road/street connecting two junctions.
Definition: MSEdge.h:77
SVCPermissions getPermissions() const
Returns the combined permissions of all lanes of this edge.
Definition: MSEdge.h:622
const MSJunction * getToJunction() const
Definition: MSEdge.h:415
double getLength() const
return the length of the edge
Definition: MSEdge.h:658
const MSJunction * getFromJunction() const
Definition: MSEdge.h:411
bool isTazConnector() const
Definition: MSEdge.h:288
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:406
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:1156
static bool gUseMesoSim
Definition: MSGlobals.h:103
static bool gCheckRoutes
Definition: MSGlobals.h:88
static bool gLefthand
Whether lefthand-drive is being simulated.
Definition: MSGlobals.h:169
The simulated network and simulation perfomer.
Definition: MSNet.h:88
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1490
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:183
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:320
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition: MSNet.cpp:1350
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:378
const MSEdge * getDestination() const
returns the destination edge
Definition: MSStage.cpp:61
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
Definition: MSStage.cpp:102
virtual double getArrivalPos() const
Definition: MSStage.h:89
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
Definition: MSStage.h:238
const std::string myGroup
The id of the group of transportables traveling together.
Definition: MSStage.h:253
virtual const std::string setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now, const bool vehicleArrived)
logs end of the step
Definition: MSStage.cpp:127
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
Definition: MSStage.h:80
bool wasSet(int what) const
Definition: MSStage.h:224
MSStageType getStageType() const
Definition: MSStage.h:117
void setArrivalPos(double arrivalPos)
Definition: MSStage.h:93
SUMOTime myArrived
the time at which this stage ended
Definition: MSStage.h:247
void markSet(int what)
Definition: MSStage.h:228
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
Definition: MSStage.cpp:149
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
Definition: MSStage.h:259
double myArrivalPos
the position at which we want to arrive
Definition: MSStage.h:241
Position getEdgePosition(const MSEdge *e, double at, double offset) const
get position on edge e at length at with orthogonal offset
Definition: MSStage.cpp:138
const MSEdge * myDestination
the next edge to reach by getting transported
Definition: MSStage.h:235
const bool myHaveArrivalPos
whether an arrivalPos was in the input
Definition: MSStageTrip.h:136
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSStageTrip.cpp:87
MSStageTrip(const MSEdge *origin, MSStoppingPlace *fromStop, const MSEdge *destination, MSStoppingPlace *toStop, const SUMOTime duration, const SVCPermissions modeSet, const std::string &vTypes, const double speed, const double walkFactor, const std::string &group, const double departPosLat, const bool hasArrivalPos, const double arrivalPos)
constructor
Definition: MSStageTrip.cpp:50
void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, MSStage *previous)
proceeds to the next step
const std::string setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now, const bool vehicleArrived)
logs end of the step
std::string getStageSummary(const bool isPerson) const
return string summary of the current stage
const std::string myVTypes
The possible vehicles to use.
Definition: MSStageTrip.h:121
double myDepartPos
The depart position.
Definition: MSStageTrip.h:130
double getEdgePos(SUMOTime now) const
MSStage * clone() const
Definition: MSStageTrip.cpp:72
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSStageTrip.cpp:94
void routeOutput(const bool isPerson, OutputDevice &os, const bool withRouteLength, const MSStage *const previous) const
Called on writing vehroute output.
const MSEdge * myOrigin
the origin edge
Definition: MSStageTrip.h:109
const double mySpeed
The walking speed.
Definition: MSStageTrip.h:124
MSStoppingPlace * myOriginStop
the origin edge
Definition: MSStageTrip.h:112
SUMOTime myDuration
the time the trip should take (applies to only walking)
Definition: MSStageTrip.h:115
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSStageTrip.h:127
const double myDepartPosLat
The lateral depart position.
Definition: MSStageTrip.h:133
const SVCPermissions myModeSet
The allowed modes of transportation.
Definition: MSStageTrip.h:118
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSStageTrip.cpp:80
virtual ~MSStageTrip()
destructor
Definition: MSStageTrip.cpp:69
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
SumoXMLTag getElement() const
return the type of this stopping place
double getEndLanePosition() const
Returns the end position of this stop.
double getAccessPos(const MSEdge *edge) const
the position on the given edge which is connected to this stop, -1 on failure
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
virtual bool proceed(MSNet *net, SUMOTime time, const bool vehicleArrived=false)
int getNumStages() const
Return the total number stages in this persons plan.
MSStage * getNextStage(int next) const
Return the current stage.
void appendStage(MSStage *stage, int next=-1)
Appends the given stage to the current plan.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and physical maximum speed)
The class responsible for building and deletion of vehicles.
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, ConstMSRoutePtr route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true, bool addRouteStops=true)
Builds a vehicle, increases the number of built vehicles.
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
virtual bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, SumoRNG *rng=nullptr, bool readOnly=false)
Returns the named vehicle type or a sample from the named distribution.
The car-following model and parameter.
Definition: MSVehicleType.h:63
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:91
const std::string & getID() const
Returns the id.
Definition: Named.h:74
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:59
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:254
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1)
Definition: RandHelper.cpp:94
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
Representation of a vehicle.
Definition: SUMOVehicle.h:62
virtual bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true, std::string *msgReturn=nullptr)=0
Replaces the current route by the given edges.
virtual void setArrivalPos(double arrivalPos)=0
Sets this vehicle's desired arrivalPos for its current route.
Structure representing possible vehicle parameter.
double departPos
(optional) The position the vehicle shall depart from
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
bool hasNext()
returns the information whether further substrings exist
#define M_PI
Definition: odrSpiral.cpp:45