Eclipse SUMO - Simulation of Urban MObility
Simulation.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-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 /****************************************************************************/
15 // C++ TraCI client API implementation
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
24 #include <utils/common/StdDefs.h>
32 #include <utils/xml/XMLSubSys.h>
33 #include <microsim/MSNet.h>
34 #include <microsim/MSEdgeControl.h>
36 #include <microsim/MSEdge.h>
37 #include <microsim/MSLane.h>
38 #include <microsim/MSVehicle.h>
43 #include <microsim/MSParkingArea.h>
45 #include <netload/NLBuilder.h>
46 #include <libsumo/TraCIConstants.h>
47 #include "Simulation.h"
48 #include <libsumo/TraCIDefs.h>
49 
50 
51 namespace libsumo {
52 // ===========================================================================
53 // static member initializations
54 // ===========================================================================
57 
58 
59 // ===========================================================================
60 // static member definitions
61 // ===========================================================================
62 void
63 Simulation::load(const std::vector<std::string>& args) {
64  close();
66  OptionsIO::setArgs(args);
69 }
70 
71 
72 bool
74  return MSNet::hasInstance();
75 }
76 
77 
78 void
79 Simulation::step(const double time) {
81  const SUMOTime t = TIME2STEPS(time);
82  if (t == 0) {
84  } else {
85  while (MSNet::getInstance()->getCurrentTimeStep() < t) {
87  }
88  }
90 }
91 
92 
93 void
96  if (MSNet::hasInstance()) {
98  delete MSNet::getInstance();
101  }
102 }
103 
104 
105 void
106 Simulation::subscribe(const std::vector<int>& varIDs, double begin, double end) {
108 }
109 
110 
111 const TraCIResults
113  return mySubscriptionResults[""];
114 }
115 
116 
117 int
119  return (int)MSNet::getInstance()->getCurrentTimeStep();
120 }
121 
122 
123 double
125  return SIMTIME;
126 }
127 
128 
129 int
132 }
133 
134 
135 std::vector<std::string>
138 }
139 
140 
141 int
144 }
145 
146 
147 std::vector<std::string>
150 }
151 
152 
153 int
156 }
157 
158 
159 std::vector<std::string>
162 }
163 
164 
165 int
168 }
169 
170 
171 std::vector<std::string>
174 }
175 
176 
177 int
180 }
181 
182 
183 std::vector<std::string>
186 }
187 
188 
189 int
192 }
193 
194 
195 std::vector<std::string>
198 }
199 
200 
201 int
204 }
205 
206 
207 std::vector<std::string>
210 }
211 
212 
213 int
216 }
217 
218 
219 std::vector<std::string>
222 }
223 
224 
225 int
228 }
229 
230 
231 std::vector<std::string>
234 }
235 
236 
237 int
240 }
241 
242 
243 std::vector<std::string>
246 }
247 
248 
249 int
252 }
253 
254 
255 std::vector<std::string>
258 }
259 
260 std::vector<std::string>
262  std::vector<std::string> result;
263  for (const auto pair : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) {
264  result.push_back(pair.first);
265  }
266  return result;
267 }
268 
269 int
270 Simulation::getBusStopWaiting(const std::string& id) {
272  if (s == nullptr) {
273  throw TraCIException("Unknown bus stop '" + id + "'.");
274  }
275  return s->getTransportableNumber();
276 }
277 
278 std::vector<std::string>
279 Simulation::getBusStopWaitingIDList(const std::string& id) {
281  std::vector<MSTransportable*> transportables = s->getTransportables();
282  std::vector<std::string> result;
283  for (std::vector<MSTransportable*>::iterator it = transportables.begin(); it != transportables.end(); it++) {
284  result.push_back((*it)->getID());
285  }
286  return result;
287 }
288 
289 
290 double
292  return TS;
293 }
294 
295 
300  tb[0].x = b.xmin();
301  tb[1].x = b.xmax();
302  tb[0].y = b.ymin();
303  tb[1].y = b.ymax();
304  tb[0].z = b.zmin();
305  tb[1].z = b.zmax();
306  return tb;
307 }
308 
309 
310 int
312  MSNet* net = MSNet::getInstance();
315  + (net->hasPersons() ? net->getPersonControl().getActiveCount() : 0)
316  + (net->hasContainers() ? net->getContainerControl().getActiveCount() : 0));
317 }
318 
319 
321 Simulation::convert2D(const std::string& edgeID, double pos, int laneIndex, bool toGeo) {
322  Position result = Helper::getLaneChecking(edgeID, laneIndex, pos)->geometryPositionAtOffset(pos);
323  if (toGeo) {
325  }
326  result.setz(0.);
327  return Helper::makeTraCIPosition(result);
328 }
329 
330 
332 Simulation::convert3D(const std::string& edgeID, double pos, int laneIndex, bool toGeo) {
333  Position result = Helper::getLaneChecking(edgeID, laneIndex, pos)->geometryPositionAtOffset(pos);
334  if (toGeo) {
336  }
337  return Helper::makeTraCIPosition(result, true);
338 }
339 
340 
342 Simulation::convertRoad(double x, double y, bool isGeo, const std::string& vClass) {
343  Position pos(x, y);
344  if (isGeo) {
346  }
347  if (!SumoVehicleClassStrings.hasString(vClass)) {
348  throw TraCIException("Unknown vehicle class '" + vClass + "'.");
349  }
350  const SUMOVehicleClass vc = SumoVehicleClassStrings.get(vClass);
351  std::pair<MSLane*, double> roadPos = libsumo::Helper::convertCartesianToRoadMap(pos, vc);
352  if (roadPos.first == nullptr) {
353  throw TraCIException("Cannot convert position to road.");
354  }
355  TraCIRoadPosition result;
356  result.edgeID = roadPos.first->getEdge().getID();
357  result.laneIndex = roadPos.first->getIndex();
358  result.pos = roadPos.second;
359  return result;
360 }
361 
362 
364 Simulation::convertGeo(double x, double y, bool fromGeo) {
365  Position pos(x, y);
366  if (fromGeo) {
368  } else {
370  }
371  return Helper::makeTraCIPosition(pos);
372 }
373 
374 
375 double
376 Simulation::getDistance2D(double x1, double y1, double x2, double y2, bool isGeo, bool isDriving) {
377  Position pos1(x1, y1);
378  Position pos2(x2, y2);
379  if (isGeo) {
382  }
383  if (isDriving) {
384  std::pair<const MSLane*, double> roadPos1 = libsumo::Helper::convertCartesianToRoadMap(pos1, SVC_IGNORING);
385  std::pair<const MSLane*, double> roadPos2 = libsumo::Helper::convertCartesianToRoadMap(pos2, SVC_IGNORING);
386  if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) {
387  // same edge
388  return roadPos2.second - roadPos1.second;
389  } else {
390  double distance = 0.;
391  ConstMSEdgeVector newRoute;
392  if (roadPos2.first->isInternal()) {
393  distance = roadPos2.second;
394  roadPos2.first = roadPos2.first->getLogicalPredecessorLane();
395  roadPos2.second = roadPos2.first->getLength();
396  }
398  &roadPos1.first->getEdge(), &roadPos2.first->getEdge(), nullptr, MSNet::getInstance()->getCurrentTimeStep(), newRoute);
399  MSRoute route("", newRoute, false, nullptr, std::vector<SUMOVehicleParameter::Stop>());
400  return distance + route.getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge());
401  }
402  } else {
403  return pos1.distanceTo(pos2);
404  }
405 }
406 
407 
408 double
409 Simulation::getDistanceRoad(const std::string& edgeID1, double pos1, const std::string& edgeID2, double pos2, bool isDriving) {
410  std::pair<const MSLane*, double> roadPos1 = std::make_pair(libsumo::Helper::getLaneChecking(edgeID1, 0, pos1), pos1);
411  std::pair<const MSLane*, double> roadPos2 = std::make_pair(libsumo::Helper::getLaneChecking(edgeID2, 0, pos2), pos2);
412  if (isDriving) {
413  if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) {
414  // same edge
415  return roadPos2.second - roadPos1.second;
416  } else {
417  double distance = 0.;
418  ConstMSEdgeVector newRoute;
419  if (roadPos2.first->isInternal()) {
420  distance = roadPos2.second;
421  roadPos2.first = roadPos2.first->getLogicalPredecessorLane();
422  roadPos2.second = roadPos2.first->getLength();
423  }
425  &roadPos1.first->getEdge(), &roadPos2.first->getEdge(), nullptr, MSNet::getInstance()->getCurrentTimeStep(), newRoute);
426  MSRoute route("", newRoute, false, nullptr, std::vector<SUMOVehicleParameter::Stop>());
427  return distance + route.getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge());
428  }
429  } else {
430  const Position p1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
431  const Position p2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
432  return p1.distanceTo(p2);
433  }
434 }
435 
436 
438 Simulation::findRoute(const std::string& from, const std::string& to, const std::string& typeID, const double depart, const int routingMode) {
440  const MSEdge* const fromEdge = MSEdge::dictionary(from);
441  if (fromEdge == nullptr) {
442  throw TraCIException("Unknown from edge '" + from + "'.");
443  }
444  const MSEdge* const toEdge = MSEdge::dictionary(to);
445  if (toEdge == nullptr) {
446  throw TraCIException("Unknown to edge '" + from + "'.");
447  }
448  SUMOVehicle* vehicle = nullptr;
449  if (typeID != "") {
452  if (type == nullptr) {
453  throw TraCIException("The vehicle type '" + typeID + "' is not known.");
454  }
455  try {
456  const MSRoute* const routeDummy = new MSRoute("", ConstMSEdgeVector({ fromEdge }), false, nullptr, std::vector<SUMOVehicleParameter::Stop>());
457  vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(pars, routeDummy, type, false);
458  // we need to fix the speed factor here for deterministic results
459  vehicle->setChosenSpeedFactor(type->getSpeedFactor().getParameter()[0]);
460  } catch (ProcessError& e) {
461  throw TraCIException("Invalid departure edge for vehicle type '" + typeID + "' (" + e.what() + ")");
462  }
463  }
464  ConstMSEdgeVector edges;
465  const SUMOTime dep = depart < 0 ? MSNet::getInstance()->getCurrentTimeStep() : TIME2STEPS(depart);
467  router.compute(fromEdge, toEdge, vehicle, dep, edges);
468  for (const MSEdge* e : edges) {
469  result.edges.push_back(e->getID());
470  }
471  result.travelTime = result.cost = router.recomputeCosts(edges, vehicle, dep, &result.length);
472  if (vehicle != nullptr) {
474  }
475  return result;
476 }
477 
478 
479 std::vector<TraCIStage>
480 Simulation::findIntermodalRoute(const std::string& from, const std::string& to,
481  const std::string& modes, double depart, const int routingMode, double speed, double walkFactor,
482  double departPos, double arrivalPos, const double departPosLat,
483  const std::string& pType, const std::string& vType, const std::string& destStop) {
484  UNUSED_PARAMETER(departPosLat);
485  std::vector<TraCIStage> result;
486  const MSEdge* const fromEdge = MSEdge::dictionary(from);
487  if (fromEdge == nullptr) {
488  throw TraCIException("Unknown from edge '" + from + "'.");
489  }
490  const MSEdge* const toEdge = MSEdge::dictionary(to);
491  if (toEdge == nullptr) {
492  throw TraCIException("Unknown to edge '" + to + "'.");
493  }
495  SVCPermissions modeSet = 0;
496  std::vector<SUMOVehicleParameter*> pars;
497  if (vType != "") {
498  pars.push_back(new SUMOVehicleParameter());
499  pars.back()->vtypeid = vType;
500  pars.back()->id = vType;
501  modeSet |= SVC_PASSENGER;
502  }
503  for (StringTokenizer st(modes); st.hasNext();) {
504  const std::string mode = st.next();
505  if (mode == toString(PERSONMODE_CAR)) {
506  pars.push_back(new SUMOVehicleParameter());
507  pars.back()->vtypeid = DEFAULT_VTYPE_ID;
508  pars.back()->id = mode;
509  modeSet |= SVC_PASSENGER;
510  } else if (mode == toString(PERSONMODE_BICYCLE)) {
511  pars.push_back(new SUMOVehicleParameter());
512  pars.back()->vtypeid = DEFAULT_BIKETYPE_ID;
513  pars.back()->id = mode;
514  modeSet |= SVC_BICYCLE;
515  } else if (mode == toString(PERSONMODE_PUBLIC)) {
516  pars.push_back(nullptr);
517  modeSet |= SVC_BUS;
518  } else if (mode == toString(PERSONMODE_WALK)) {
519  // do nothing
520  } else {
521  throw TraCIException("Unknown person mode '" + mode + "'.");
522  }
523  }
524  if (pars.empty()) {
525  pars.push_back(nullptr);
526  }
527  // interpret default arguments
528  const MSVehicleType* pedType = vehControl.hasVType(pType) ? vehControl.getVType(pType) : vehControl.getVType(DEFAULT_PEDTYPE_ID);
529  SUMOTime departStep = TIME2STEPS(depart);
530  if (depart < 0) {
531  departStep = MSNet::getInstance()->getCurrentTimeStep();
532  }
533  if (speed < 0) {
534  speed = pedType->getMaxSpeed();
535  }
536  if (walkFactor < 0) {
537  walkFactor = OptionsCont::getOptions().getFloat("persontrip.walkfactor");
538  }
539  const double externalFactor = StringUtils::toDouble(pedType->getParameter().getParameter("externalEffortFactor", "100"));
540  if (departPos < 0) {
541  departPos += fromEdge->getLength();
542  }
543  if (arrivalPos == INVALID_DOUBLE_VALUE) {
544  arrivalPos = toEdge->getLength() / 2;
545  } else if (arrivalPos < 0) {
546  arrivalPos += toEdge->getLength();
547  }
548  if (departPos < 0 || departPos >= fromEdge->getLength()) {
549  throw TraCIException("Invalid depart position " + toString(departPos) + " for edge '" + to + "'.");
550  }
551  if (arrivalPos < 0 || arrivalPos >= toEdge->getLength()) {
552  throw TraCIException("Invalid arrival position " + toString(arrivalPos) + " for edge '" + to + "'.");
553  }
554  double minCost = std::numeric_limits<double>::max();
556  for (SUMOVehicleParameter* vehPar : pars) {
557  std::vector<TraCIStage> resultCand;
558  SUMOVehicle* vehicle = nullptr;
559  if (vehPar != nullptr) {
560  MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(vehPar->vtypeid);
561  if (type == nullptr) {
562  throw TraCIException("Unknown vehicle type '" + vehPar->vtypeid + "'.");
563  }
564  if (type->getVehicleClass() != SVC_IGNORING && (fromEdge->getPermissions() & type->getVehicleClass()) == 0) {
565  WRITE_WARNING("Ignoring vehicle type '" + type->getID() + "' when performing intermodal routing because it is not allowed on the start edge '" + from + "'.");
566  } else {
567  const MSRoute* const routeDummy = new MSRoute(vehPar->id, ConstMSEdgeVector({ fromEdge }), false, nullptr, std::vector<SUMOVehicleParameter::Stop>());
568  vehicle = vehControl.buildVehicle(vehPar, routeDummy, type, !MSGlobals::gCheckRoutes);
569  // we need to fix the speed factor here for deterministic results
570  vehicle->setChosenSpeedFactor(type->getSpeedFactor().getParameter()[0]);
571  }
572  }
573  std::vector<MSNet::MSIntermodalRouter::TripItem> items;
574  if (router.compute(fromEdge, toEdge, departPos, arrivalPos, destStop,
575  speed * walkFactor, vehicle, modeSet, departStep, items, externalFactor)) {
576  double cost = 0;
577  for (std::vector<MSNet::MSIntermodalRouter::TripItem>::iterator it = items.begin(); it != items.end(); ++it) {
578  if (!it->edges.empty()) {
579  resultCand.push_back(TraCIStage(it->line == ""
582  resultCand.back().vType = it->vType;
583  resultCand.back().line = it->line;
584  resultCand.back().destStop = it->destStop;
585  for (const MSEdge* e : it->edges) {
586  resultCand.back().edges.push_back(e->getID());
587  }
588  resultCand.back().travelTime = it->traveltime;
589  resultCand.back().cost = it->cost;
590  resultCand.back().length = it->length;
591  resultCand.back().intended = it->intended;
592  resultCand.back().depart = it->depart;
593  resultCand.back().departPos = it->departPos;
594  resultCand.back().arrivalPos = it->arrivalPos;
595  resultCand.back().description = it->description;
596  }
597  cost += it->cost;
598  }
599  if (cost < minCost) {
600  minCost = cost;
601  result = resultCand;
602  }
603  }
604  if (vehicle != nullptr) {
605  vehControl.deleteVehicle(vehicle, true);
606  }
607  }
608  return result;
609 }
610 
611 
612 std::string
613 Simulation::getParameter(const std::string& objectID, const std::string& key) {
614  if (StringUtils::startsWith(key, "chargingStation.")) {
615  const std::string attrName = key.substr(16);
617  if (cs == nullptr) {
618  throw TraCIException("Invalid chargingStation '" + objectID + "'");
619  }
620  if (attrName == toString(SUMO_ATTR_TOTALENERGYCHARGED)) {
621  return toString(cs->getTotalCharged());
622  } else if (attrName == toString(SUMO_ATTR_NAME)) {
623  return toString(cs->getMyName());
624  } else if (attrName == "lane") {
625  return cs->getLane().getID();
626  } else if (cs->knowsParameter(attrName)) {
627  return cs->getParameter(attrName);
628  } else {
629  throw TraCIException("Invalid chargingStation parameter '" + attrName + "'");
630  }
631  } else if (StringUtils::startsWith(key, "parkingArea.")) {
632  const std::string attrName = key.substr(12);
634  if (pa == nullptr) {
635  throw TraCIException("Invalid parkingArea '" + objectID + "'");
636  }
637  if (attrName == "capacity") {
638  return toString(pa->getCapacity());
639  } else if (attrName == "occupancy") {
641  } else if (attrName == toString(SUMO_ATTR_NAME)) {
642  return toString(pa->getMyName());
643  } else if (attrName == "lane") {
644  return pa->getLane().getID();
645  } else if (pa->knowsParameter(attrName)) {
646  return pa->getParameter(attrName);
647  } else {
648  throw TraCIException("Invalid parkingArea parameter '" + attrName + "'");
649  }
650  } else if (StringUtils::startsWith(key, "busStop.")) {
651  const std::string attrName = key.substr(8);
653  if (bs == nullptr) {
654  throw TraCIException("Invalid busStop '" + objectID + "'");
655  }
656  if (attrName == toString(SUMO_ATTR_NAME)) {
657  return toString(bs->getMyName());
658  } else if (attrName == "lane") {
659  return bs->getLane().getID();
660  } else if (bs->knowsParameter(attrName)) {
661  return bs->getParameter(attrName);
662  } else {
663  throw TraCIException("Invalid busStop parameter '" + attrName + "'");
664  }
665  } else {
666  throw TraCIException("Parameter '" + key + "' is not supported.");
667  }
668 }
669 
670 
671 void
672 Simulation::clearPending(const std::string& routeID) {
674 }
675 
676 
677 void
678 Simulation::saveState(const std::string& fileName) {
679  MSStateHandler::saveState(fileName, MSNet::getInstance()->getCurrentTimeStep());
680 }
681 
682 void
683 Simulation::writeMessage(const std::string& msg) {
684  WRITE_MESSAGE(msg);
685 }
686 
687 
688 std::shared_ptr<VariableWrapper>
690  return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
691 }
692 
693 
694 bool
695 Simulation::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) {
696  switch (variable) {
697  case VAR_TIME:
698  return wrapper->wrapDouble(objID, variable, getTime());
699  case VAR_TIME_STEP:
700  return wrapper->wrapInt(objID, variable, (int)getCurrentTime());
702  return wrapper->wrapInt(objID, variable, getLoadedNumber());
704  return wrapper->wrapStringList(objID, variable, getLoadedIDList());
706  return wrapper->wrapInt(objID, variable, getDepartedNumber());
708  return wrapper->wrapStringList(objID, variable, getDepartedIDList());
710  return wrapper->wrapInt(objID, variable, getStartingTeleportNumber());
712  return wrapper->wrapStringList(objID, variable, getStartingTeleportIDList());
714  return wrapper->wrapInt(objID, variable, getEndingTeleportNumber());
716  return wrapper->wrapStringList(objID, variable, getEndingTeleportIDList());
718  return wrapper->wrapInt(objID, variable, getArrivedNumber());
720  return wrapper->wrapStringList(objID, variable, getArrivedIDList());
722  return wrapper->wrapInt(objID, variable, getParkingStartingVehiclesNumber());
724  return wrapper->wrapStringList(objID, variable, getParkingStartingVehiclesIDList());
726  return wrapper->wrapInt(objID, variable, getParkingEndingVehiclesNumber());
728  return wrapper->wrapStringList(objID, variable, getParkingEndingVehiclesIDList());
730  return wrapper->wrapInt(objID, variable, getStopStartingVehiclesNumber());
732  return wrapper->wrapStringList(objID, variable, getStopStartingVehiclesIDList());
734  return wrapper->wrapInt(objID, variable, getStopEndingVehiclesNumber());
736  return wrapper->wrapStringList(objID, variable, getStopEndingVehiclesIDList());
738  return wrapper->wrapInt(objID, variable, getCollidingVehiclesNumber());
740  return wrapper->wrapStringList(objID, variable, getCollidingVehiclesIDList());
742  return wrapper->wrapInt(objID, variable, getEmergencyStoppingVehiclesNumber());
744  return wrapper->wrapStringList(objID, variable, getEmergencyStoppingVehiclesIDList());
745  case VAR_DELTA_T:
746  return wrapper->wrapDouble(objID, variable, getDeltaT());
748  return wrapper->wrapInt(objID, variable, getMinExpectedNumber());
750  return wrapper->wrapInt(objID, variable, getBusStopWaiting(objID));
751  default:
752  return false;
753  }
754 }
755 
756 
757 }
758 
759 
760 /****************************************************************************/
libsumo::Simulation::getEndingTeleportNumber
static int getEndingTeleportNumber()
Definition: Simulation.cpp:250
libsumo::Simulation::step
static void step(const double time=0.)
Advances by one step (or up to the given time)
Definition: Simulation.cpp:79
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
SUMOAbstractRouter::compute
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
MSStoppingPlace::getLane
const MSLane & getLane() const
Returns the lane this stop is located at.
Definition: MSStoppingPlace.cpp:57
libsumo::Helper::handleSubscriptions
static void handleSubscriptions(const SUMOTime t)
Definition: Helper.cpp:144
UNUSED_PARAMETER
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:31
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
Definition: TraCIConstants.h:930
MSNet::getRouterTT
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:968
MSNet::getStoppingPlace
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition: MSNet.cpp:911
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:93
libsumo::VAR_PARKING_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_IDS
Definition: TraCIConstants.h:906
libsumo::VAR_LOADED_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_NUMBER
Definition: TraCIConstants.h:852
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:59
libsumo::VAR_STOP_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_NUMBER
Definition: TraCIConstants.h:897
MSParkingArea
A lane area vehicles can halt at.
Definition: MSParkingArea.h:59
MSTransportableControl::getActiveCount
int getActiveCount()
return the number of active transportable objects
Definition: MSTransportableControl.cpp:249
MSNet::VEHICLE_STATE_DEPARTED
@ VEHICLE_STATE_DEPARTED
The vehicle has departed (was inserted into the network)
Definition: MSNet.h:539
TraCIPositionVector
A list of positions.
SystemFrame::close
static void close()
Closes all of an applications subsystems.
Definition: SystemFrame.cpp:133
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MSNet::hasContainers
bool hasContainers() const
Returns whether containers are simulated.
Definition: MSNet.h:369
GeoConvHelper::getConvBoundary
const Boundary & getConvBoundary() const
Returns the converted boundary.
Definition: GeoConvHelper.cpp:489
MSNet.h
SUMOVehicle::setChosenSpeedFactor
virtual void setChosenSpeedFactor(const double factor)=0
libsumo::INVALID_DOUBLE_VALUE
TRACI_CONST double INVALID_DOUBLE_VALUE
Definition: TraCIConstants.h:362
DEFAULT_PEDTYPE_ID
const std::string DEFAULT_PEDTYPE_ID
MSVehicleControl::getVType
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
Definition: MSVehicleControl.cpp:353
XMLSubSys::close
static void close()
Closes the xml-subsystem.
Definition: XMLSubSys.cpp:90
Boundary::zmax
double zmax() const
Returns maximum z-coordinate.
Definition: Boundary.cpp:148
MSNet::simulationStep
void simulationStep()
Performs a single simulation step.
Definition: MSNet.cpp:466
GeoConvHelper::x2cartesian_const
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
Definition: GeoConvHelper.cpp:417
libsumo::Simulation::getCollidingVehiclesNumber
static int getCollidingVehiclesNumber()
Definition: Simulation.cpp:214
Boundary::ymin
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:130
libsumo::VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
Definition: TraCIConstants.h:870
MSInsertionControl::getPendingFlowCount
int getPendingFlowCount() const
Returns the number of flows that are still active.
Definition: MSInsertionControl.cpp:265
NLBuilder.h
libsumo::TraCIResults
std::map< int, std::shared_ptr< TraCIResult > > TraCIResults
{variable->value}
Definition: TraCIDefs.h:201
libsumo::TraCIPosition
A 3D-position.
Definition: TraCIDefs.h:109
libsumo::VariableWrapper
Definition: Subscription.h:132
MSVehicleControl::getActiveVehicleCount
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
Definition: MSVehicleControl.h:283
OptionsCont.h
StringTokenizer::hasNext
bool hasNext()
returns the information whether further substrings exist
Definition: StringTokenizer.cpp:94
IntermodalRouter
Definition: MSNet.h:79
StringUtils::toDouble
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: StringUtils.cpp:345
libsumo::VAR_TELEPORT_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_NUMBER
Definition: TraCIConstants.h:864
MSNet::getContainerControl
virtual MSTransportableControl & getContainerControl()
Returns the container control.
Definition: MSNet.cpp:818
libsumo::Simulation::getMinExpectedNumber
static int getMinExpectedNumber()
Definition: Simulation.cpp:311
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
libsumo::VAR_BUS_STOP_WAITING
TRACI_CONST int VAR_BUS_STOP_WAITING
Definition: TraCIConstants.h:813
MSNet::getInsertionControl
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:389
libsumo::Simulation::getStopStartingVehiclesIDList
static std::vector< std::string > getStopStartingVehiclesIDList()
Definition: Simulation.cpp:196
libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
Definition: TraCIConstants.h:927
libsumo::Simulation::getNetBoundary
static TraCIPositionVector getNetBoundary()
Definition: Simulation.cpp:297
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
libsumo::VAR_TIME
TRACI_CONST int VAR_TIME
Definition: TraCIConstants.h:843
GeoConvHelper.h
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
Boundary::xmax
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:124
SVC_BICYCLE
@ SVC_BICYCLE
vehicle is a bicycle
Definition: SUMOVehicleClass.h:179
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
libsumo::Simulation::load
static void load(const std::vector< std::string > &args)
load a simulation with the given arguments
Definition: Simulation.cpp:63
libsumo::Helper::subscribe
static void subscribe(const int commandId, const std::string &id, const std::vector< int > &variables, const double beginTime, const double endTime, const int contextDomain=0, const double range=0.)
Definition: Helper.cpp:120
libsumo::ContextSubscriptionResults
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:204
MSNet::hasPersons
bool hasPersons() const
Returns whether persons are simulated.
Definition: MSNet.h:353
libsumo::Simulation::convertRoad
static TraCIRoadPosition convertRoad(double x, double y, bool isGeo=false, const std::string &vClass="ignoring")
Definition: Simulation.cpp:342
Distribution_Parameterized::getParameter
std::vector< double > & getParameter()
Returns the parameters of this distribution.
Definition: Distribution_Parameterized.cpp:110
libsumo::VAR_TIME_STEP
TRACI_CONST int VAR_TIME_STEP
Definition: TraCIConstants.h:846
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
MSEdge.h
libsumo::Helper::makeTraCIPosition
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
Definition: Helper.cpp:309
MSInsertionControl.h
libsumo::Simulation::getParkingEndingVehiclesNumber
static int getParkingEndingVehiclesNumber()
Definition: Simulation.cpp:178
libsumo::Simulation::getStopEndingVehiclesNumber
static int getStopEndingVehiclesNumber()
Definition: Simulation.cpp:202
libsumo::TraCIRoadPosition::edgeID
std::string edgeID
Definition: TraCIDefs.h:127
MSNet::VEHICLE_STATE_ARRIVED
@ VEHICLE_STATE_ARRIVED
The vehicle arrived at his destination (is deleted)
Definition: MSNet.h:545
MSRoutingEngine::getRouterTT
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
Definition: MSRoutingEngine.cpp:307
MSEdge::getLength
double getLength() const
return the length of the edge
Definition: MSEdge.h:589
MSStateHandler::saveState
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
Definition: MSStateHandler.cpp:74
MSNet::closeSimulation
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
Definition: MSNet.cpp:445
MSRoute
Definition: MSRoute.h:66
MSNet::VEHICLE_STATE_EMERGENCYSTOP
@ VEHICLE_STATE_EMERGENCYSTOP
The vehicle had to brake harder than permitted.
Definition: MSNet.h:559
SUMO_ATTR_TOTALENERGYCHARGED
@ SUMO_ATTR_TOTALENERGYCHARGED
Definition: SUMOXMLDefinitions.h:533
libsumo::Simulation::convert2D
static TraCIPosition convert2D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
Definition: Simulation.cpp:321
Parameterised::getParameter
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Definition: Parameterised.cpp:72
libsumo::Simulation::clearPending
static void clearPending(const std::string &routeID="")
Definition: Simulation.cpp:672
libsumo::Simulation::getDistance2D
static double getDistance2D(double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false)
Definition: Simulation.cpp:376
MSVehicle.h
SumoVehicleClassStrings
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
libsumo::Helper::getLaneChecking
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
Definition: Helper.cpp:335
libsumo
Definition: Edge.cpp:29
libsumo::Simulation::getSubscriptionResults
static const TraCIResults getSubscriptionResults()
Definition: Simulation.cpp:112
MSVehicleControl::buildVehicle
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
Definition: MSVehicleControl.cpp:100
libsumo::Simulation::getArrivedNumber
static int getArrivedNumber()
Definition: Simulation.cpp:154
libsumo::Simulation::isLoaded
static bool isLoaded()
return whether a simulation (network) is present
Definition: Simulation.cpp:73
IntermodalRouter::compute
bool compute(const E *from, const E *to, const double departPos, 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...
Definition: IntermodalRouter.h:108
libsumo::VariableWrapper::wrapDouble
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
libsumo::VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
Definition: TraCIConstants.h:891
libsumo::TraCIStage::travelTime
double travelTime
duration of the stage in seconds
Definition: TraCIDefs.h:359
libsumo::Simulation::writeMessage
static void writeMessage(const std::string &msg)
Definition: Simulation.cpp:683
Simulation.h
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:63
MSNet::VEHICLE_STATE_STARTING_PARKING
@ VEHICLE_STATE_STARTING_PARKING
The vehicles starts to park.
Definition: MSNet.h:549
MSNet::getIntermodalRouter
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1006
libsumo::Simulation::getBusStopWaitingIDList
static std::vector< std::string > getBusStopWaitingIDList(const std::string &id)
Returns the IDs of the transportables on a given bus stop.
Definition: Simulation.cpp:279
TraCIConstants.h
SUMO_TAG_CHARGING_STATION
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
Definition: SUMOXMLDefinitions.h:111
Boundary::xmin
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:118
libsumo::Simulation::getStartingTeleportIDList
static std::vector< std::string > getStartingTeleportIDList()
Definition: Simulation.cpp:244
libsumo::CMD_SUBSCRIBE_SIM_VARIABLE
TRACI_CONST int CMD_SUBSCRIBE_SIM_VARIABLE
Definition: TraCIConstants.h:260
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
MSTransportableControl.h
SystemFrame.h
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:58
PedestrianRouter.h
libsumo::VAR_DEPARTED_VEHICLES_IDS
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
Definition: TraCIConstants.h:861
TS
#define TS
Definition: SUMOTime.h:43
libsumo::VariableWrapper::wrapStringList
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
MSStoppingPlace::getTransportables
std::vector< MSTransportable * > getTransportables() const
Returns the tranportables waiting on this stop.
Definition: MSStoppingPlace.cpp:171
Position::distanceTo
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:233
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:283
StringTokenizer
Definition: StringTokenizer.h:61
DEFAULT_VTYPE_ID
const std::string DEFAULT_VTYPE_ID
MSParkingArea::getCapacity
int getCapacity() const
Returns the area capacity.
Definition: MSParkingArea.cpp:348
MSEdge::dictionary
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
Definition: MSEdge.cpp:765
libsumo::VAR_DELTA_T
TRACI_CONST int VAR_DELTA_T
Definition: TraCIConstants.h:882
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
libsumo::Simulation::getDepartedIDList
static std::vector< std::string > getDepartedIDList()
Definition: Simulation.cpp:148
libsumo::Simulation::getTime
static double getTime()
Definition: Simulation.cpp:124
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
libsumo::TraCIStage
Definition: TraCIDefs.h:344
SUMO_TAG_PARKING_AREA
@ SUMO_TAG_PARKING_AREA
A parking area.
Definition: SUMOXMLDefinitions.h:107
libsumo::Simulation::convertGeo
static TraCIPosition convertGeo(double x, double y, bool fromGeo=false)
Definition: Simulation.cpp:364
libsumo::VAR_TELEPORT_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_IDS
Definition: TraCIConstants.h:873
MSVehicleControl::deleteVehicle
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
Definition: MSVehicleControl.cpp:250
libsumo::VAR_TELEPORT_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_IDS
Definition: TraCIConstants.h:867
ProcessError
Definition: UtilExceptions.h:39
MSNet::VEHICLE_STATE_COLLISION
@ VEHICLE_STATE_COLLISION
The vehicle is involved in a collision.
Definition: MSNet.h:557
libsumo::TraCIStage::length
double length
length in m
Definition: TraCIDefs.h:363
MSNet::VEHICLE_STATE_STARTING_TELEPORT
@ VEHICLE_STATE_STARTING_TELEPORT
The vehicle started to teleport.
Definition: MSNet.h:541
GeoConvHelper::cartesian2geo
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Definition: GeoConvHelper.cpp:293
MSNet::VEHICLE_STATE_BUILT
@ VEHICLE_STATE_BUILT
The vehicle was built, but has not yet departed.
Definition: MSNet.h:537
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
libsumo::Simulation::close
static void close()
close simulation
Definition: Simulation.cpp:94
MSNet::VEHICLE_STATE_STARTING_STOP
@ VEHICLE_STATE_STARTING_STOP
The vehicles starts to stop.
Definition: MSNet.h:553
NLBuilder::init
static MSNet * init()
Definition: NLBuilder.cpp:219
libsumo::Simulation::getArrivedIDList
static std::vector< std::string > getArrivedIDList()
Definition: Simulation.cpp:160
XMLSubSys::init
static void init()
Initialises the xml-subsystem.
Definition: XMLSubSys.cpp:47
libsumo::VAR_ARRIVED_VEHICLES_NUMBER
TRACI_CONST int VAR_ARRIVED_VEHICLES_NUMBER
Definition: TraCIConstants.h:876
libsumo::Simulation::getDistanceRoad
static double getDistanceRoad(const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false)
Definition: Simulation.cpp:409
MSChargingStation
Definition: MSChargingStation.h:50
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
libsumo::Simulation::getCurrentTime
static int getCurrentTime()
Definition: Simulation.cpp:118
libsumo::Simulation::makeWrapper
static std::shared_ptr< VariableWrapper > makeWrapper()
Definition: Simulation.cpp:689
StringUtils::startsWith
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
Definition: StringUtils.cpp:174
MSGlobals::gCheckRoutes
static bool gCheckRoutes
Definition: MSGlobals.h:78
libsumo::Simulation::getEmergencyStoppingVehiclesNumber
static int getEmergencyStoppingVehiclesNumber()
Definition: Simulation.cpp:226
libsumo::Simulation::convert3D
static TraCIPosition convert3D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
Definition: Simulation.cpp:332
MSParkingArea.h
libsumo::Simulation::getParkingStartingVehiclesIDList
static std::vector< std::string > getParkingStartingVehiclesIDList()
Definition: Simulation.cpp:172
MSRoutingEngine.h
libsumo::VAR_STOP_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
Definition: TraCIConstants.h:900
libsumo::Simulation::getDeltaT
static double getDeltaT()
Definition: Simulation.cpp:291
PERSONMODE_CAR
@ PERSONMODE_CAR
Definition: SUMOXMLDefinitions.h:1121
MSTransportable::DRIVING
@ DRIVING
Definition: MSTransportable.h:64
libsumo::Simulation::getDepartedNumber
static int getDepartedNumber()
Definition: Simulation.cpp:142
libsumo::VAR_PARKING_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
Definition: TraCIConstants.h:903
libsumo::Simulation::getStartingTeleportNumber
static int getStartingTeleportNumber()
Definition: Simulation.cpp:238
libsumo::TraCIException
Definition: TraCIDefs.h:89
libsumo::Simulation::getBusStopIDList
static std::vector< std::string > getBusStopIDList()
Definition: Simulation.cpp:261
libsumo::VAR_COLLIDING_VEHICLES_IDS
TRACI_CONST int VAR_COLLIDING_VEHICLES_IDS
Definition: TraCIConstants.h:924
MSVehicleType::getSpeedFactor
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
Definition: MSVehicleType.h:209
libsumo::Simulation::getParkingEndingVehiclesIDList
static std::vector< std::string > getParkingEndingVehiclesIDList()
Definition: Simulation.cpp:184
MSStoppingPlace::getMyName
const std::string & getMyName() const
Definition: MSStoppingPlace.cpp:265
SUMOAbstractRouter< MSEdge, SUMOVehicle >
libsumo::Simulation::mySubscriptionResults
static SubscriptionResults mySubscriptionResults
Definition: Simulation.h:135
libsumo::Simulation::getStopStartingVehiclesNumber
static int getStopStartingVehiclesNumber()
Definition: Simulation.cpp:190
libsumo::Simulation::getBusStopWaiting
static int getBusStopWaiting(const std::string &id)
Definition: Simulation.cpp:270
MSEdgeControl.h
OptionsCont::getFloat
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
Definition: OptionsCont.cpp:208
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:97
libsumo::ROUTING_MODE_AGGREGATED
TRACI_CONST int ROUTING_MODE_AGGREGATED
Definition: TraCIConstants.h:454
PERSONMODE_WALK
@ PERSONMODE_WALK
Definition: SUMOXMLDefinitions.h:1119
libsumo::Helper::clearSubscriptions
static void clearSubscriptions()
Definition: Helper.cpp:180
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
MSNet::getPersonControl
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:810
libsumo::Simulation::myContextSubscriptionResults
static ContextSubscriptionResults myContextSubscriptionResults
Definition: Simulation.h:136
MSStateHandler.h
SUMOAbstractRouter::recomputeCosts
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Definition: SUMOAbstractRouter.h:195
MSInsertionControl::clearPendingVehicles
void clearPendingVehicles(const std::string &route)
clears out all pending vehicles from a route, "" for all routes
Definition: MSInsertionControl.cpp:284
libsumo::Simulation::getLoadedIDList
static std::vector< std::string > getLoadedIDList()
Definition: Simulation.cpp:136
libsumo::Simulation::subscribe
static void subscribe(const std::vector< int > &varIDs=std::vector< int >(), double begin=INVALID_DOUBLE_VALUE, double end=INVALID_DOUBLE_VALUE)
Definition: Simulation.cpp:106
libsumo::Simulation::saveState
static void saveState(const std::string &fileName)
Definition: Simulation.cpp:678
MSParkingArea::getOccupancyIncludingBlocked
int getOccupancyIncludingBlocked() const
Returns the area occupancy.
Definition: MSParkingArea.cpp:360
libsumo::TraCIStage::edges
std::vector< std::string > edges
The sequence of edges to travel.
Definition: TraCIDefs.h:357
libsumo::VariableWrapper::wrapInt
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
libsumo::Simulation::findIntermodalRoute
static std::vector< TraCIStage > findIntermodalRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &modes="", double depart=-1., const int routingMode=0, double speed=-1., double walkFactor=-1., double departPos=0, double arrivalPos=INVALID_DOUBLE_VALUE, const double departPosLat=0, const std::string &pType="", const std::string &vType="", const std::string &destStop="")
Definition: Simulation.cpp:480
libsumo::VAR_DEPARTED_VEHICLES_NUMBER
TRACI_CONST int VAR_DEPARTED_VEHICLES_NUMBER
Definition: TraCIConstants.h:858
MSNet::VEHICLE_STATE_ENDING_PARKING
@ VEHICLE_STATE_ENDING_PARKING
The vehicle ends to park.
Definition: MSNet.h:551
MSChargingStation::getTotalCharged
double getTotalCharged() const
Definition: MSChargingStation.h:97
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:560
libsumo::Simulation::getStopEndingVehiclesIDList
static std::vector< std::string > getStopEndingVehiclesIDList()
Definition: Simulation.cpp:208
libsumo::TraCIRoadPosition::pos
double pos
Definition: TraCIDefs.h:128
OptionsIO::setArgs
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:54
libsumo::Simulation::getLoadedNumber
static int getLoadedNumber()
Definition: Simulation.cpp:130
MSNet::VEHICLE_STATE_ENDING_TELEPORT
@ VEHICLE_STATE_ENDING_TELEPORT
The vehicle ended being teleported.
Definition: MSNet.h:543
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:161
libsumo::Simulation::getParameter
static std::string getParameter(const std::string &objectID, const std::string &key)
Definition: Simulation.cpp:613
libsumo::VAR_PARKING_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_IDS
Definition: TraCIConstants.h:918
MSStoppingPlace::getTransportableNumber
int getTransportableNumber() const
Returns the number of transportables waiting on this stop.
Definition: MSStoppingPlace.h:158
libsumo::VAR_LOADED_VEHICLES_IDS
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
Definition: TraCIConstants.h:855
MSNet::hasInstance
static bool hasInstance()
Returns whether the network was already constructed.
Definition: MSNet.h:143
libsumo::TraCIRoadPosition
An edgeId, position and laneIndex.
Definition: TraCIDefs.h:121
config.h
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:71
libsumo::Simulation::getCollidingVehiclesIDList
static std::vector< std::string > getCollidingVehiclesIDList()
Definition: Simulation.cpp:220
libsumo::VAR_STOP_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS
Definition: TraCIConstants.h:894
SVC_BUS
@ SVC_BUS
vehicle is a bus
Definition: SUMOVehicleClass.h:165
MSTransportable::MOVING_WITHOUT_VEHICLE
@ MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:63
libsumo::Simulation::handleVariable
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: Simulation.cpp:695
libsumo::VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
Definition: TraCIConstants.h:879
StringTokenizer.h
PERSONMODE_PUBLIC
@ PERSONMODE_PUBLIC
Definition: SUMOXMLDefinitions.h:1122
StdDefs.h
libsumo::VAR_COLLIDING_VEHICLES_NUMBER
TRACI_CONST int VAR_COLLIDING_VEHICLES_NUMBER
Definition: TraCIConstants.h:921
MSLane::geometryPositionAtOffset
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:504
MSVehicleControl::hasVType
bool hasVType(const std::string &id) const
Asks for existence of a vehicle type.
Definition: MSVehicleControl.cpp:341
libsumo::Helper::getVehicleStateChanges
static const std::vector< std::string > & getVehicleStateChanges(const MSNet::VehicleState state)
Definition: Helper.cpp:423
MSLane.h
SUMO_ATTR_NAME
@ SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:380
MSVehicleType::getVehicleClass
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
Definition: MSVehicleType.h:184
MSEdge::getPermissions
SVCPermissions getPermissions() const
Definition: MSEdge.h:553
SVC_IGNORING
@ SVC_IGNORING
vehicles ignoring classes
Definition: SUMOVehicleClass.h:135
DEFAULT_BIKETYPE_ID
const std::string DEFAULT_BIKETYPE_ID
MSRoute::getDistanceBetween
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes....
Definition: MSRoute.cpp:278
MSStoppingPlace.h
MSVehicleControl.h
Position::setz
void setz(double z)
set position z
Definition: Position.h:81
TraCIDefs.h
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
MSNet::VEHICLE_STATE_ENDING_STOP
@ VEHICLE_STATE_ENDING_STOP
The vehicle ends to stop.
Definition: MSNet.h:555
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:277
libsumo::Helper::registerVehicleStateListener
static void registerVehicleStateListener()
Definition: Helper.cpp:415
libsumo::Helper::convertCartesianToRoadMap
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
Definition: Helper.cpp:352
libsumo::VAR_MIN_EXPECTED_VEHICLES
TRACI_CONST int VAR_MIN_EXPECTED_VEHICLES
Definition: TraCIConstants.h:888
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:336
libsumo::Simulation::findRoute
static TraCIStage findRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0)
Definition: Simulation.cpp:438
Boundary::zmin
double zmin() const
Returns minimum z-coordinate.
Definition: Boundary.cpp:142
libsumo::SubscriptionResults
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:203
libsumo::TraCIRoadPosition::laneIndex
int laneIndex
Definition: TraCIDefs.h:129
libsumo::TraCIStage::cost
double cost
effort needed
Definition: TraCIDefs.h:361
libsumo::VAR_PARKING_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
Definition: TraCIConstants.h:915
libsumo::Simulation::getEndingTeleportIDList
static std::vector< std::string > getEndingTeleportIDList()
Definition: Simulation.cpp:256
OptionsIO.h
IntermodalRouter.h
PERSONMODE_BICYCLE
@ PERSONMODE_BICYCLE
Definition: SUMOXMLDefinitions.h:1120
libsumo::Helper::clearVehicleStates
static void clearVehicleStates()
Definition: Helper.cpp:429
Parameterised::knowsParameter
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
Definition: Parameterised.cpp:66
XMLSubSys.h
Boundary::ymax
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:136
libsumo::Simulation::getEmergencyStoppingVehiclesIDList
static std::vector< std::string > getEmergencyStoppingVehiclesIDList()
Definition: Simulation.cpp:232
libsumo::Simulation::getParkingStartingVehiclesNumber
static int getParkingStartingVehiclesNumber()
Definition: Simulation.cpp:166