70 std::pair<int, std::string>
71 Simulation::start(
const std::vector<std::string>& cmd,
int ,
int ,
const std::string& ,
const bool ,
72 const std::string& ,
bool ,
void* ) {
73 load(std::vector<std::string>(cmd.begin() + 1, cmd.end()));
79 Simulation::load(
const std::vector<std::string>& args) {
80 close(
"Libsumo issued load command.");
91 throw TraCIException(e.what());
97 Simulation::isLoaded() {
103 Simulation::step(
const double time) {
119 Simulation::close(
const std::string& reason) {
131 Simulation::subscribe(
const std::vector<int>& varIDs,
double begin,
double end,
const libsumo::TraCIResults& params) {
137 Simulation::getSubscriptionResults() {
138 return mySubscriptionResults[
""];
145 std::pair<int, std::string>
146 Simulation::getVersion() {
152 Simulation::getCurrentTime() {
158 Simulation::getTime() {
163 Simulation::getEndTime() {
169 Simulation::getLoadedNumber() {
174 std::vector<std::string>
175 Simulation::getLoadedIDList() {
181 Simulation::getDepartedNumber() {
186 std::vector<std::string>
187 Simulation::getDepartedIDList() {
193 Simulation::getArrivedNumber() {
198 std::vector<std::string>
199 Simulation::getArrivedIDList() {
205 Simulation::getParkingStartingVehiclesNumber() {
210 std::vector<std::string>
211 Simulation::getParkingStartingVehiclesIDList() {
217 Simulation::getParkingEndingVehiclesNumber() {
222 std::vector<std::string>
223 Simulation::getParkingEndingVehiclesIDList() {
229 Simulation::getStopStartingVehiclesNumber() {
234 std::vector<std::string>
235 Simulation::getStopStartingVehiclesIDList() {
241 Simulation::getStopEndingVehiclesNumber() {
246 std::vector<std::string>
247 Simulation::getStopEndingVehiclesIDList() {
253 Simulation::getCollidingVehiclesNumber() {
258 std::vector<std::string>
259 Simulation::getCollidingVehiclesIDList() {
265 Simulation::getEmergencyStoppingVehiclesNumber() {
270 std::vector<std::string>
271 Simulation::getEmergencyStoppingVehiclesIDList() {
277 Simulation::getStartingTeleportNumber() {
282 std::vector<std::string>
283 Simulation::getStartingTeleportIDList() {
289 Simulation::getEndingTeleportNumber() {
294 std::vector<std::string>
295 Simulation::getEndingTeleportIDList() {
300 Simulation::getDepartedPersonNumber() {
305 std::vector<std::string>
306 Simulation::getDepartedPersonIDList() {
312 Simulation::getArrivedPersonNumber() {
317 std::vector<std::string>
318 Simulation::getArrivedPersonIDList() {
322 std::vector<std::string>
323 Simulation::getBusStopIDList() {
324 std::vector<std::string> result;
326 result.push_back(pair.first);
332 Simulation::getBusStopWaiting(
const std::string& stopID) {
335 throw TraCIException(
"Unknown bus stop '" + stopID +
"'.");
340 std::vector<std::string>
341 Simulation::getBusStopWaitingIDList(
const std::string& stopID) {
344 throw TraCIException(
"Unknown bus stop '" + stopID +
"'.");
346 std::vector<std::string> result;
348 result.push_back(t->getID());
354 std::vector<std::string>
355 Simulation::getPendingVehicles() {
356 std::vector<std::string> result;
358 result.push_back(veh->getID());
364 std::vector<libsumo::TraCICollision>
365 Simulation::getCollisions() {
366 std::vector<libsumo::TraCICollision> result;
379 result.push_back(c2);
386 Simulation::getDeltaT() {
392 Simulation::getNetBoundary() {
394 TraCIPositionVector tb;
403 tb.value.push_back(minV);
404 tb.value.push_back(maxV);
410 Simulation::getMinExpectedNumber() {
420 Simulation::convert2D(
const std::string& edgeID,
double pos,
int laneIndex,
bool toGeo) {
431 Simulation::convert3D(
const std::string& edgeID,
double pos,
int laneIndex,
bool toGeo) {
441 Simulation::convertRoad(
double x,
double y,
bool isGeo,
const std::string& vClass) {
447 throw TraCIException(
"Unknown vehicle class '" + vClass +
"'.");
451 if (roadPos.first ==
nullptr) {
452 throw TraCIException(
"Cannot convert position to road.");
454 TraCIRoadPosition result;
455 result.edgeID = roadPos.first->getEdge().getID();
456 result.laneIndex = roadPos.first->getIndex();
457 result.pos = roadPos.second;
463 Simulation::convertGeo(
double x,
double y,
bool fromGeo) {
475 Simulation::getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo,
bool isDriving) {
493 Simulation::getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving) {
499 const Position p1 = roadPos1.first->geometryPositionAtOffset(roadPos1.second);
500 const Position p2 = roadPos2.first->geometryPositionAtOffset(roadPos2.second);
507 Simulation::findRoute(
const std::string& from,
const std::string& to,
const std::string& typeID,
const double depart,
const int routingMode) {
510 if (fromEdge ==
nullptr) {
511 throw TraCIException(
"Unknown from edge '" + from +
"'.");
514 if (toEdge ==
nullptr) {
515 throw TraCIException(
"Unknown to edge '" + from +
"'.");
519 if (type ==
nullptr) {
520 throw TraCIException(
"The vehicle type '" + typeID +
"' is not known.");
523 pars->
id =
"simulation.findRoute";
530 throw TraCIException(
"Invalid departure edge for vehicle type '" + type->
getID() +
"' (" + msg +
")");
535 throw TraCIException(
"Invalid departure edge for vehicle type '" + type->
getID() +
"' (" + e.what() +
")");
540 router.
compute(fromEdge, toEdge, vehicle, dep, edges);
541 for (
const MSEdge* e : edges) {
542 result.edges.push_back(e->getID());
544 result.travelTime = result.cost = router.
recomputeCosts(edges, vehicle, dep, &result.length);
545 if (vehicle !=
nullptr) {
552 std::vector<TraCIStage>
553 Simulation::findIntermodalRoute(
const std::string& from,
const std::string& to,
554 const std::string& modes,
double depart,
const int routingMode,
double speed,
double walkFactor,
555 double departPos,
double arrivalPos,
const double departPosLat,
556 const std::string& pType,
const std::string& vType,
const std::string& destStop) {
558 std::vector<TraCIStage> result;
560 if (fromEdge ==
nullptr) {
561 throw TraCIException(
"Unknown from edge '" + from +
"'.");
564 if (toEdge ==
nullptr) {
565 throw TraCIException(
"Unknown to edge '" + to +
"'.");
569 std::vector<SUMOVehicleParameter*> pars;
572 pars.back()->vtypeid = vType;
573 pars.back()->id = vType;
577 const std::string mode = st.next();
581 pars.back()->id = mode;
586 pars.back()->id = mode;
591 pars.back()->id = mode;
594 pars.push_back(
nullptr);
599 throw TraCIException(
"Unknown person mode '" + mode +
"'.");
603 pars.push_back(
nullptr);
614 if (walkFactor < 0) {
623 }
else if (arrivalPos < 0) {
626 if (departPos < 0 || departPos >= fromEdge->
getLength()) {
627 throw TraCIException(
"Invalid depart position " +
toString(departPos) +
" for edge '" + to +
"'.");
629 if (arrivalPos < 0 || arrivalPos >= toEdge->
getLength()) {
630 throw TraCIException(
"Invalid arrival position " +
toString(arrivalPos) +
" for edge '" + to +
"'.");
632 double minCost = std::numeric_limits<double>::max();
635 std::vector<TraCIStage> resultCand;
637 if (vehPar !=
nullptr) {
639 if (type ==
nullptr) {
640 throw TraCIException(
"Unknown vehicle type '" + vehPar->vtypeid +
"'.");
643 WRITE_WARNING(
"Ignoring vehicle type '" + type->
getID() +
"' when performing intermodal routing because it is not allowed on the start edge '" + from +
"'.");
651 std::vector<MSNet::MSIntermodalRouter::TripItem> items;
652 if (router.
compute(fromEdge, toEdge, departPos,
"", arrivalPos, destStop,
653 speed * walkFactor, vehicle, modeSet, departStep, items, externalFactor)) {
655 for (std::vector<MSNet::MSIntermodalRouter::TripItem>::iterator it = items.begin(); it != items.end(); ++it) {
656 if (!it->edges.empty()) {
658 for (
const MSEdge* e : it->edges) {
659 resultCand.back().edges.push_back(e->
getID());
661 resultCand.back().travelTime = it->traveltime;
662 resultCand.back().cost = it->cost;
663 resultCand.back().length = it->length;
664 resultCand.back().intended = it->intended;
665 resultCand.back().depart = it->depart;
666 resultCand.back().departPos = it->departPos;
667 resultCand.back().arrivalPos = it->arrivalPos;
668 resultCand.back().description = it->description;
672 if (cost < minCost) {
677 if (vehicle !=
nullptr) {
686 Simulation::getParameter(
const std::string& objectID,
const std::string& key) {
688 const std::string attrName = key.substr(16);
691 throw TraCIException(
"Invalid chargingStation '" + objectID +
"'");
697 }
else if (attrName ==
"lane") {
702 throw TraCIException(
"Invalid chargingStation parameter '" + attrName +
"'");
705 const std::string attrName = key.substr(16);
708 throw TraCIException(
"Invalid overhead wire '" + objectID +
"'");
715 throw TraCIException(
"Invalid overhead wire parameter '" + attrName +
"'");
718 const std::string attrName = key.substr(4);
723 throw TraCIException(
"Invalid net parameter '" + attrName +
"'");
726 const std::string attrName = key.substr(12);
729 throw TraCIException(
"Invalid parkingArea '" + objectID +
"'");
731 if (attrName ==
"capacity") {
733 }
else if (attrName ==
"occupancy") {
737 }
else if (attrName ==
"lane") {
742 throw TraCIException(
"Invalid parkingArea parameter '" + attrName +
"'");
745 const std::string attrName = key.substr(8);
748 throw TraCIException(
"Invalid busStop '" + objectID +
"'");
752 }
else if (attrName ==
"lane") {
757 throw TraCIException(
"Invalid busStop parameter '" + attrName +
"'");
759 }
else if (objectID ==
"") {
762 throw TraCIException(
"Simulation parameter '" + key +
"' is not supported for object id '" + objectID +
"'. Use empty id for generic network parameters");
769 Simulation::setParameter(
const std::string& objectID,
const std::string& param,
const std::string& value) {
770 if (objectID ==
"") {
773 throw TraCIException(
"Setting simulation parameter '" + param +
"' is not supported for object id '" + objectID +
"'. Use empty id for generic network parameters");
778 Simulation::clearPending(
const std::string& routeID) {
784 Simulation::saveState(
const std::string& fileName) {
789 Simulation::loadState(
const std::string& fileName) {
800 throw TraCIException(
"Loading state from '" + fileName +
"' failed.");
811 Simulation::writeMessage(
const std::string& msg) {
816 std::shared_ptr<VariableWrapper>
817 Simulation::makeWrapper() {
818 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
823 Simulation::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData) {
826 return wrapper->wrapDouble(objID, variable, getTime());
828 return wrapper->wrapInt(objID, variable, (
int)getCurrentTime());
830 return wrapper->wrapDouble(objID, variable, getEndTime());
832 return wrapper->wrapInt(objID, variable, getLoadedNumber());
834 return wrapper->wrapStringList(objID, variable, getLoadedIDList());
836 return wrapper->wrapInt(objID, variable, getDepartedNumber());
838 return wrapper->wrapStringList(objID, variable, getDepartedIDList());
840 return wrapper->wrapInt(objID, variable, getStartingTeleportNumber());
842 return wrapper->wrapStringList(objID, variable, getStartingTeleportIDList());
844 return wrapper->wrapInt(objID, variable, getEndingTeleportNumber());
846 return wrapper->wrapStringList(objID, variable, getEndingTeleportIDList());
848 return wrapper->wrapInt(objID, variable, getArrivedNumber());
850 return wrapper->wrapStringList(objID, variable, getArrivedIDList());
852 return wrapper->wrapInt(objID, variable, getParkingStartingVehiclesNumber());
854 return wrapper->wrapStringList(objID, variable, getParkingStartingVehiclesIDList());
856 return wrapper->wrapInt(objID, variable, getParkingEndingVehiclesNumber());
858 return wrapper->wrapStringList(objID, variable, getParkingEndingVehiclesIDList());
860 return wrapper->wrapInt(objID, variable, getStopStartingVehiclesNumber());
862 return wrapper->wrapStringList(objID, variable, getStopStartingVehiclesIDList());
864 return wrapper->wrapInt(objID, variable, getStopEndingVehiclesNumber());
866 return wrapper->wrapStringList(objID, variable, getStopEndingVehiclesIDList());
868 return wrapper->wrapInt(objID, variable, getCollidingVehiclesNumber());
870 return wrapper->wrapStringList(objID, variable, getCollidingVehiclesIDList());
872 return wrapper->wrapInt(objID, variable, getEmergencyStoppingVehiclesNumber());
874 return wrapper->wrapStringList(objID, variable, getEmergencyStoppingVehiclesIDList());
876 return wrapper->wrapInt(objID, variable, getDepartedPersonNumber());
878 return wrapper->wrapStringList(objID, variable, getDepartedPersonIDList());
880 return wrapper->wrapInt(objID, variable, getArrivedPersonNumber());
882 return wrapper->wrapStringList(objID, variable, getArrivedPersonIDList());
884 return wrapper->wrapDouble(objID, variable, getDeltaT());
886 return wrapper->wrapInt(objID, variable, getMinExpectedNumber());
888 return wrapper->wrapStringList(objID, variable, getBusStopIDList());
890 return wrapper->wrapInt(objID, variable, getBusStopWaiting(objID));
892 return wrapper->wrapStringList(objID, variable, getBusStopWaitingIDList(objID));
894 return wrapper->wrapStringList(objID, variable, getPendingVehicles());
897 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
900 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
std::vector< const MSEdge * > ConstMSEdgeVector
#define WRITE_MESSAGE(msg)
#define WRITE_WARNING(msg)
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
#define PROGRESS_TIME_MESSAGE(before)
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
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_TAXITYPE_ID
const std::string DEFAULT_PEDTYPE_ID
const std::string DEFAULT_VTYPE_ID
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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, DOMAIN)
#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.
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.
double getTotalCharged() const
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.
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
@ 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.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
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 simulationStep()
Performs a single simulation step.
virtual void updateGUI() const
update view after simulation.loadState
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
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)
virtual MSTransportableControl & getPersonControl()
Returns the person control.
void clearState(const SUMOTime step)
Resets events when quick-loading state.
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 SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
static SUMOTime getTime(const std::string &fileName)
parse time from state file
Parser and output filter for routes and vehicles state saving and loading.
static void saveState(const std::string &file, SUMOTime step)
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.
bool hasVType(const std::string &id) const
Asks for existence of a vehicle type.
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 ...
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.
The car-following model and parameter.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
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 MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static MSNet * init(const bool isLibsumo=false)
const std::string & getID() const
Returns the id.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
static OptionsCont & getOptions()
Retrieves the options.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
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.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
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
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
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 SUMOVehicleClass getVClass() const =0
Returns the object's access class.
Representation of a vehicle.
virtual void setChosenSpeedFactor(const double factor)=0
virtual bool hasValidRouteStart(std::string &msg)=0
checks wether the vehicle can depart on the first edge
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 close()
Closes the xml-subsystem.
static void init()
Initialises the xml-subsystem.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false)
Runs the given handler on the given file; returns if everything's ok.
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 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 clearVehicleStates()
static void clearSubscriptions()
static void clearTransportableStates()
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_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}
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.