58 #ifdef HAVE_LIBSUMOGUI
76 std::pair<int, std::string>
77 Simulation::start(
const std::vector<std::string>& cmd,
int ,
int ,
const std::string& ,
const bool ,
78 const std::string& ,
bool ,
void* ) {
79 #ifdef HAVE_LIBSUMOGUI
80 if (GUI::start(cmd)) {
84 load(std::vector<std::string>(cmd.begin() + 1, cmd.end()));
90 Simulation::load(
const std::vector<std::string>& args) {
91 #ifdef HAVE_LIBSUMOGUI
92 if (GUI::load(args)) {
96 close(
"Libsumo issued load command.");
108 throw TraCIException(e.what());
114 Simulation::hasGUI() {
115 #ifdef HAVE_LIBSUMOGUI
116 return GUI::hasInstance();
124 Simulation::isLoaded() {
130 Simulation::step(
const double time) {
133 #ifdef HAVE_LIBSUMOGUI
143 #ifdef HAVE_LIBSUMOGUI
151 Simulation::executeMove() {
157 Simulation::close(
const std::string& reason) {
160 #ifdef HAVE_LIBSUMOGUI
161 !GUI::close(reason) &&
172 Simulation::subscribe(
const std::vector<int>& varIDs,
double begin,
double end,
const libsumo::TraCIResults& params) {
178 Simulation::getSubscriptionResults() {
179 return mySubscriptionResults[
""];
186 std::pair<int, std::string>
187 Simulation::getVersion() {
193 Simulation::getOption(
const std::string& option) {
196 throw TraCIException(
"The option " + option +
" is unknown.");
203 Simulation::getCurrentTime() {
209 Simulation::getTime() {
214 Simulation::getEndTime() {
220 Simulation::getLoadedNumber() {
225 std::vector<std::string>
226 Simulation::getLoadedIDList() {
232 Simulation::getDepartedNumber() {
237 std::vector<std::string>
238 Simulation::getDepartedIDList() {
244 Simulation::getArrivedNumber() {
249 std::vector<std::string>
250 Simulation::getArrivedIDList() {
256 Simulation::getParkingStartingVehiclesNumber() {
261 std::vector<std::string>
262 Simulation::getParkingStartingVehiclesIDList() {
268 Simulation::getParkingEndingVehiclesNumber() {
273 std::vector<std::string>
274 Simulation::getParkingEndingVehiclesIDList() {
280 Simulation::getStopStartingVehiclesNumber() {
285 std::vector<std::string>
286 Simulation::getStopStartingVehiclesIDList() {
292 Simulation::getStopEndingVehiclesNumber() {
297 std::vector<std::string>
298 Simulation::getStopEndingVehiclesIDList() {
304 Simulation::getCollidingVehiclesNumber() {
309 std::vector<std::string>
310 Simulation::getCollidingVehiclesIDList() {
316 Simulation::getEmergencyStoppingVehiclesNumber() {
321 std::vector<std::string>
322 Simulation::getEmergencyStoppingVehiclesIDList() {
328 Simulation::getStartingTeleportNumber() {
333 std::vector<std::string>
334 Simulation::getStartingTeleportIDList() {
340 Simulation::getEndingTeleportNumber() {
345 std::vector<std::string>
346 Simulation::getEndingTeleportIDList() {
351 Simulation::getDepartedPersonNumber() {
356 std::vector<std::string>
357 Simulation::getDepartedPersonIDList() {
363 Simulation::getArrivedPersonNumber() {
368 std::vector<std::string>
369 Simulation::getArrivedPersonIDList() {
373 std::vector<std::string>
374 Simulation::getBusStopIDList() {
375 std::vector<std::string> result;
377 result.push_back(pair.first);
383 Simulation::getBusStopWaiting(
const std::string& stopID) {
386 throw TraCIException(
"Unknown bus stop '" + stopID +
"'.");
391 std::vector<std::string>
392 Simulation::getBusStopWaitingIDList(
const std::string& stopID) {
395 throw TraCIException(
"Unknown bus stop '" + stopID +
"'.");
397 std::vector<std::string> result;
399 result.push_back(t->getID());
405 std::vector<std::string>
406 Simulation::getPendingVehicles() {
407 std::vector<std::string> result;
409 result.push_back(veh->getID());
415 std::vector<libsumo::TraCICollision>
416 Simulation::getCollisions() {
417 std::vector<libsumo::TraCICollision> result;
430 result.push_back(c2);
437 Simulation::getScale() {
442 Simulation::getDeltaT() {
448 Simulation::getNetBoundary() {
450 TraCIPositionVector tb;
459 tb.value.push_back(minV);
460 tb.value.push_back(maxV);
466 Simulation::getMinExpectedNumber() {
476 Simulation::convert2D(
const std::string& edgeID,
double pos,
int laneIndex,
bool toGeo) {
487 Simulation::convert3D(
const std::string& edgeID,
double pos,
int laneIndex,
bool toGeo) {
497 Simulation::convertRoad(
double x,
double y,
bool isGeo,
const std::string& vClass) {
503 throw TraCIException(
"Unknown vehicle class '" + vClass +
"'.");
507 if (roadPos.first ==
nullptr) {
508 throw TraCIException(
"Cannot convert position to road.");
510 TraCIRoadPosition result;
511 result.edgeID = roadPos.first->getEdge().getID();
512 result.laneIndex = roadPos.first->getIndex();
513 result.pos = roadPos.second;
519 Simulation::convertGeo(
double x,
double y,
bool fromGeo) {
531 Simulation::getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo,
bool isDriving) {
549 Simulation::getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving) {
555 const Position p1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
556 const Position p2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
563 Simulation::findRoute(
const std::string& from,
const std::string& to,
const std::string& typeID,
const double depart,
const int routingMode) {
566 if (fromEdge ==
nullptr) {
567 throw TraCIException(
"Unknown from edge '" + from +
"'.");
570 if (toEdge ==
nullptr) {
571 throw TraCIException(
"Unknown to edge '" + to +
"'.");
575 if (type ==
nullptr) {
576 throw TraCIException(
"The vehicle type '" + typeID +
"' is not known.");
579 pars->
id =
"simulation.findRoute";
581 ConstMSRoutePtr const routeDummy = std::make_shared<MSRoute>(
"",
ConstMSEdgeVector({ fromEdge }),
false,
nullptr, std::vector<SUMOVehicleParameter::Stop>());
586 throw TraCIException(
"Invalid departure edge for vehicle type '" + type->
getID() +
"' (" + msg +
")");
592 throw TraCIException(
"Invalid departure edge for vehicle type '" + type->
getID() +
"' (" + e.what() +
")");
597 router.
compute(fromEdge, toEdge, vehicle, dep, edges);
598 for (
const MSEdge* e : edges) {
599 result.edges.push_back(e->getID());
601 result.travelTime = result.cost = router.
recomputeCosts(edges, vehicle, dep, &result.length);
602 if (vehicle !=
nullptr) {
609 std::vector<TraCIStage>
610 Simulation::findIntermodalRoute(
const std::string& from,
const std::string& to,
611 const std::string& modes,
double depart,
const int routingMode,
double speed,
double walkFactor,
612 double departPos,
double arrivalPos,
const double departPosLat,
613 const std::string& pType,
const std::string& vType,
const std::string& destStop) {
615 std::vector<TraCIStage> result;
617 if (fromEdge ==
nullptr) {
618 throw TraCIException(
"Unknown from edge '" + from +
"'.");
621 if (toEdge ==
nullptr) {
622 throw TraCIException(
"Unknown to edge '" + to +
"'.");
626 std::vector<SUMOVehicleParameter*> pars;
629 pars.back()->vtypeid = vType;
630 pars.back()->id = vType;
634 const std::string mode = st.next();
638 pars.back()->id = mode;
643 pars.back()->id = mode;
648 pars.back()->id = mode;
651 pars.push_back(
nullptr);
656 throw TraCIException(
"Unknown person mode '" + mode +
"'.");
660 pars.push_back(
nullptr);
671 if (walkFactor < 0) {
680 }
else if (arrivalPos < 0) {
683 if (departPos < 0 || departPos >= fromEdge->
getLength()) {
684 throw TraCIException(
"Invalid depart position " +
toString(departPos) +
" for edge '" + from +
"'.");
686 if (arrivalPos < 0 || arrivalPos >= toEdge->
getLength()) {
687 throw TraCIException(
"Invalid arrival position " +
toString(arrivalPos) +
" for edge '" + to +
"'.");
689 double minCost = std::numeric_limits<double>::max();
692 std::vector<TraCIStage> resultCand;
694 if (vehPar !=
nullptr) {
696 if (type ==
nullptr) {
697 throw TraCIException(
"Unknown vehicle type '" + vehPar->vtypeid +
"'.");
700 WRITE_WARNINGF(
TL(
"Ignoring vehicle type '%' when performing intermodal routing because it is not allowed on the start edge '%'."), type->
getID(), from);
702 ConstMSRoutePtr const routeDummy = std::make_shared<MSRoute>(vehPar->id,
ConstMSEdgeVector({ fromEdge }),
false,
nullptr, std::vector<SUMOVehicleParameter::Stop>());
708 std::vector<MSTransportableRouter::TripItem> items;
709 if (router.
compute(fromEdge, toEdge, departPos,
"", arrivalPos, destStop,
710 speed * walkFactor, vehicle, modeSet, departStep, items, externalFactor)) {
712 for (std::vector<MSTransportableRouter::TripItem>::iterator it = items.begin(); it != items.end(); ++it) {
713 if (!it->edges.empty()) {
715 for (
const MSEdge* e : it->edges) {
716 resultCand.back().edges.push_back(e->
getID());
718 resultCand.back().travelTime = it->traveltime;
719 resultCand.back().cost = it->cost;
720 resultCand.back().length = it->length;
721 resultCand.back().intended = it->intended;
722 resultCand.back().depart = it->depart;
723 resultCand.back().departPos = it->departPos;
724 resultCand.back().arrivalPos = it->arrivalPos;
725 resultCand.back().description = it->description;
729 if (cost < minCost) {
734 if (vehicle !=
nullptr) {
743 Simulation::getParameter(
const std::string& objectID,
const std::string& key) {
745 const std::string attrName = key.substr(16);
748 throw TraCIException(
"Invalid chargingStation '" + objectID +
"'");
754 }
else if (attrName ==
"lane") {
759 throw TraCIException(
"Invalid chargingStation parameter '" + attrName +
"'");
762 const std::string attrName = key.substr(16);
765 throw TraCIException(
"Invalid overhead wire '" + objectID +
"'");
772 throw TraCIException(
"Invalid overhead wire parameter '" + attrName +
"'");
775 const std::string attrName = key.substr(4);
780 throw TraCIException(
"Invalid net parameter '" + attrName +
"'");
783 const std::string attrName = key.substr(12);
786 throw TraCIException(
"Invalid parkingArea '" + objectID +
"'");
788 if (attrName ==
"capacity") {
790 }
else if (attrName ==
"occupancy") {
794 }
else if (attrName ==
"lane") {
799 throw TraCIException(
"Invalid parkingArea parameter '" + attrName +
"'");
802 const std::string attrName = key.substr(8);
805 throw TraCIException(
"Invalid busStop '" + objectID +
"'");
809 }
else if (attrName ==
"lane") {
814 throw TraCIException(
"Invalid busStop parameter '" + attrName +
"'");
817 if (objectID !=
"") {
818 throw TraCIException(
"Simulation parameter '" + key +
"' is not supported for object id '" + objectID
819 +
"'. Use empty id for global device parameers or vehicle domain for vehicle specific parameters");
821 const std::string attrName = key.substr(16);
823 }
else if (objectID ==
"") {
826 throw TraCIException(
"Simulation parameter '" + key +
"' is not supported for object id '" + objectID +
"'. Use empty id for generic network parameters");
833 Simulation::setParameter(
const std::string& objectID,
const std::string& key,
const std::string& value) {
834 if (objectID ==
"") {
837 throw TraCIException(
"Setting simulation parameter '" + key +
"' is not supported for object id '" + objectID +
"'. Use empty id for generic network parameters");
842 Simulation::setScale(
double value) {
847 Simulation::clearPending(
const std::string& routeID) {
853 Simulation::saveState(
const std::string& fileName) {
858 Simulation::loadState(
const std::string& fileName) {
867 throw TraCIException(
"Loading state from '" + fileName +
"' failed. " + e.what());
869 throw TraCIException(
"Loading state from '" + fileName +
"' failed, check whether SUMO versions match. " + e.what());
874 Simulation::writeMessage(
const std::string& msg) {
885 std::shared_ptr<VariableWrapper>
886 Simulation::makeWrapper() {
887 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
892 Simulation::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData) {
895 return wrapper->wrapDouble(objID, variable, getTime());
897 return wrapper->wrapInt(objID, variable, (
int)getCurrentTime());
899 return wrapper->wrapDouble(objID, variable, getEndTime());
901 return wrapper->wrapInt(objID, variable, getLoadedNumber());
903 return wrapper->wrapStringList(objID, variable, getLoadedIDList());
905 return wrapper->wrapInt(objID, variable, getDepartedNumber());
907 return wrapper->wrapStringList(objID, variable, getDepartedIDList());
909 return wrapper->wrapInt(objID, variable, getStartingTeleportNumber());
911 return wrapper->wrapStringList(objID, variable, getStartingTeleportIDList());
913 return wrapper->wrapInt(objID, variable, getEndingTeleportNumber());
915 return wrapper->wrapStringList(objID, variable, getEndingTeleportIDList());
917 return wrapper->wrapInt(objID, variable, getArrivedNumber());
919 return wrapper->wrapStringList(objID, variable, getArrivedIDList());
921 return wrapper->wrapInt(objID, variable, getParkingStartingVehiclesNumber());
923 return wrapper->wrapStringList(objID, variable, getParkingStartingVehiclesIDList());
925 return wrapper->wrapInt(objID, variable, getParkingEndingVehiclesNumber());
927 return wrapper->wrapStringList(objID, variable, getParkingEndingVehiclesIDList());
929 return wrapper->wrapInt(objID, variable, getStopStartingVehiclesNumber());
931 return wrapper->wrapStringList(objID, variable, getStopStartingVehiclesIDList());
933 return wrapper->wrapInt(objID, variable, getStopEndingVehiclesNumber());
935 return wrapper->wrapStringList(objID, variable, getStopEndingVehiclesIDList());
937 return wrapper->wrapInt(objID, variable, getCollidingVehiclesNumber());
939 return wrapper->wrapStringList(objID, variable, getCollidingVehiclesIDList());
941 return wrapper->wrapInt(objID, variable, getEmergencyStoppingVehiclesNumber());
943 return wrapper->wrapStringList(objID, variable, getEmergencyStoppingVehiclesIDList());
945 return wrapper->wrapInt(objID, variable, getDepartedPersonNumber());
947 return wrapper->wrapStringList(objID, variable, getDepartedPersonIDList());
949 return wrapper->wrapInt(objID, variable, getArrivedPersonNumber());
951 return wrapper->wrapStringList(objID, variable, getArrivedPersonIDList());
953 return wrapper->wrapDouble(objID, variable, getScale());
955 return wrapper->wrapDouble(objID, variable, getDeltaT());
957 return wrapper->wrapString(objID, variable, getOption(objID));
959 return wrapper->wrapInt(objID, variable, getMinExpectedNumber());
961 return wrapper->wrapStringList(objID, variable, getBusStopIDList());
963 return wrapper->wrapInt(objID, variable, getBusStopWaiting(objID));
965 return wrapper->wrapStringList(objID, variable, getBusStopWaitingIDList(objID));
967 return wrapper->wrapStringList(objID, variable, getPendingVehicles());
970 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
973 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
std::vector< const MSEdge * > ConstMSEdgeVector
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_MESSAGE(msg)
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
#define PROGRESS_TIME_MESSAGE(before)
std::shared_ptr< const MSRoute > ConstMSRoutePtr
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const std::string DEFAULT_TAXITYPE_ID
const std::string DEFAULT_PEDTYPE_ID
const std::string DEFAULT_VTYPE_ID
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ 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_BIKETYPE_ID
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_ATTR_TOTALENERGYCHARGED
#define UNUSED_PARAMETER(x)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
A class that stores a 2D geometrical boundary.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
PositionVector getShape(const bool closeShape) const
get position vector (shape) based on this boundary
double zmin() const
Returns minimum z-coordinate.
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
double zmax() const
Returns maximum z-coordinate.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
const Position getOffsetBase() const
Returns the network base.
const Boundary & getConvBoundary() const
Returns the converted boundary.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
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...
C++ TraCI client API implementation.
The base class for microscopic and mesoscopic vehicles.
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
void setRoutingMode(int value)
Sets routing behavior.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
virtual bool hasValidRouteStart(std::string &msg)
checks wether the vehicle can depart on the first edge
double getTotalCharged() const
static std::string getGlobalParameter(const std::string &prefixedKey)
try to retrieve the given parameter from the global statistics. Throw exception for unsupported key
A road/street connecting two junctions.
SVCPermissions getPermissions() const
Returns the combined permissions of all lanes of this edge.
double getLength() const
return the length of the edge
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....
void clearPendingVehicles(const std::string &route)
clears out all pending vehicles from a route, "" for all routes
int getPendingFlowCount() const
Returns the number of flows that are still active.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
The simulated network and simulation perfomer.
SUMOTime loadState(const std::string &fileName, const bool catchExceptions)
load state from file and return new time
@ ENDING_PARKING
The vehicle ends to park.
@ STARTING_STOP
The vehicles starts to stop.
@ BUILT
The vehicle was built, but has not yet departed.
@ STARTING_PARKING
The vehicles starts to park.
@ STARTING_TELEPORT
The vehicle started to teleport.
@ ENDING_STOP
The vehicle ends to stop.
@ ENDING_TELEPORT
The vehicle ended being teleported.
@ ARRIVED
The vehicle arrived at his destination (is deleted)
@ DEPARTED
The vehicle has departed (was inserted into the network)
@ COLLISION
The vehicle is involved in a collision.
@ EMERGENCYSTOP
The vehicle had to brake harder than permitted.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getContainerControl()
Returns the container control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
MSTransportableRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static bool hasInstance()
Returns whether the network was already constructed.
void closeSimulation(SUMOTime start, const std::string &reason="")
Closes the simulation (all files, connections, etc.)
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
void simulationStep(const bool onlyMove=false)
Performs a single simulation step.
bool hasContainers() const
Returns whether containers are simulated.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
bool hasPersons() const
Returns whether persons are simulated.
@ PERSON_DEPARTED
The transportable person has departed (was inserted into the network)
@ PERSON_ARRIVED
The transportable person arrived at his destination (is deleted)
MSVehicleRouter & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition of overhead wire segment.
double getTotalCharged() const
A lane area vehicles can halt at.
int getCapacity() const
Returns the area capacity.
int getOccupancyIncludingBlocked() const
Returns the area occupancy.
static MSVehicleRouter & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the vehicle router instance
static void saveState(const std::string &file, SUMOTime step, bool usePrefix=true)
Saves the current state.
A lane area vehicles can halt at.
std::vector< const MSTransportable * > getTransportables() const
Returns the tranportables waiting on this stop.
int getTransportableNumber() const
Returns the number of transportables waiting on this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
const std::string & getMyName() const
int getActiveCount()
return the number of active transportable objects
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.
bool hasVType(const std::string &id) const
Asks for existence of a vehicle type.
double getScale() const
sets the demand scaling factor
void setScale(double scale)
sets the demand scaling factor
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
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.
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
The car-following model and parameter.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
double getMaxSpeed() const
Get vehicle's (technical) maximum speed [m/s].
double getDesiredMaxSpeed() const
Returns the vehicles's desired maximum speed.
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
const std::string & getID() const
Returns the name of the vehicle type.
const SUMOVTypeParameter & getParameter() const
static MSNet * init(const bool isLibsumo=false)
const std::string & getID() const
Returns the id.
A storage for options typed value containers)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
static OptionsCont & getOptions()
Retrieves the options.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
A point in 2D or 3D with translation and scaling methods.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void setz(double z)
set position z
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...
virtual double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
Representation of a vehicle.
virtual void setChosenSpeedFactor(const double factor)=0
Structure representing possible vehicle parameter.
std::string id
The vehicle's id.
bool hasNext()
returns the information whether further substrings exist
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static void close()
Closes all of an applications subsystems.
static void init()
Initialises the xml-subsystem.
static double getDrivingDistance(std::pair< const MSLane *, double > &roadPos1, std::pair< const MSLane *, double > &roadPos2)
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
static void clearStateChanges()
static void subscribe(const int commandId, const std::string &id, const std::vector< int > &variables, const double beginTime, const double endTime, const libsumo::TraCIResults ¶ms, const int contextDomain=0, const double range=0.)
static const std::vector< std::string > & getTransportableStateChanges(const MSNet::TransportableState state)
static void clearSubscriptions()
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
static const std::vector< std::string > & getVehicleStateChanges(const MSNet::VehicleState state)
static void handleSubscriptions(const SUMOTime t)
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_MIN_EXPECTED_VEHICLES
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_IDS
TRACI_CONST int CMD_SUBSCRIBE_SIM_VARIABLE
TRACI_CONST int VAR_ARRIVED_VEHICLES_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_SCALE
TRACI_CONST int VAR_DEPARTED_VEHICLES_NUMBER
TRACI_CONST int VAR_COLLIDING_VEHICLES_NUMBER
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_DEPARTED_PERSONS_NUMBER
TRACI_CONST int VAR_ARRIVED_PERSONS_IDS
TRACI_CONST int ROUTING_MODE_AGGREGATED
TRACI_CONST int VAR_PENDING_VEHICLES
TRACI_CONST int VAR_BUS_STOP_ID_LIST
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int TRACI_VERSION
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_WAITING_IDS
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_DEPARTED_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_PARKING_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_IDS
TRACI_CONST int VAR_DELTA_T
TRACI_CONST int STAGE_WALKING
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int VAR_DEPARTED_PERSONS_IDS
TRACI_CONST int VAR_ARRIVED_PERSONS_NUMBER
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_STOP_ENDING_VEHICLES_NUMBER
TRACI_CONST int VAR_LOADED_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_ENDING_VEHICLES_IDS
TRACI_CONST int VAR_COLLIDING_VEHICLES_IDS
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_TELEPORT_STARTING_VEHICLES_IDS
TRACI_CONST int VAR_BUS_STOP_WAITING
TRACI_CONST int VAR_TIME_STEP
TRACI_CONST int VAR_ARRIVED_VEHICLES_IDS
TRACI_CONST int STAGE_DRIVING
TRACI_CONST int VAR_PARKING_STARTING_VEHICLES_NUMBER
TRACI_CONST int VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
TRACI_CONST int VAR_OPTION
std::string lane
The lane where the collision happended.
std::string type
The type of collision.
std::string collider
The ids of the participating vehicles and persons.
double pos
The position of the collision along the lane.