45 const std::string& host =
"localhost",
const std::string& label =
"default", FILE*
const pipe =
nullptr);
47 static bool isLibsumo();
50 static void switchConnection(
const std::string& label);
52 static const std::string& getLabel();
54 static void setOrder(
int order);
59 const std::string& label =
"default",
const bool verbose =
false,
60 const std::string& traceFile =
"",
bool traceGetters =
true,
void* _stdout =
nullptr);
63 static void load(
const std::vector<std::string>& args);
72 static void step(
const double time = 0.);
78 static void close(
const std::string& reason =
"Libsumo requested termination.");
81 static std::pair<int, std::string>
getVersion();
84 static std::string
getOption(
const std::string& option);
145 static double getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo =
false,
bool isDriving =
false);
146 static double getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving =
false);
148 static libsumo::TraCIStage findRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& vType =
"",
const double depart = -1.,
const int routingMode = 0);
153 static std::vector<libsumo::TraCIStage>
findIntermodalRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& modes =
"",
154 double depart = -1.,
const int routingMode = 0,
double speed = -1.,
double walkFactor = -1.,
156 const std::string& pType =
"",
const std::string& vType =
"",
const std::string& destStop =
"");
158 static std::string
getParameter(
const std::string& objectID,
const std::string& key);
159 static const std::pair<std::string, std::string>
getParameterWithKey(
const std::string& objectID,
const std::string& key);
160 static void setParameter(
const std::string& objectID,
const std::string& key,
const std::string& value);
163 static void clearPending(
const std::string& routeID =
"");
164 static void saveState(
const std::string& fileName);
166 static double loadState(
const std::string& fileName);
178 static std::shared_ptr<VariableWrapper> makeWrapper();
180 static bool handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData);
#define LIBSUMO_SUBSCRIPTION_API
C++ TraCI client API implementation.
static std::vector< std::string > getDepartedIDList()
static std::vector< libsumo::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=libsumo::INVALID_DOUBLE_VALUE, const double departPosLat=0, const std::string &pType="", const std::string &vType="", const std::string &destStop="")
static int getEmergencyStoppingVehiclesNumber()
static std::vector< std::string > getParkingEndingVehiclesIDList()
static libsumo::TraCIRoadPosition convertRoad(double x, double y, bool isGeo=false, const std::string &vClass="ignoring")
static int getParkingEndingVehiclesNumber()
static SubscriptionResults mySubscriptionResults
static int getDepartedNumber()
static int getArrivedPersonNumber()
static double getEndTime()
return configured end time
static void saveState(const std::string &fileName)
static void close(const std::string &reason="Libsumo requested termination.")
close simulation
static void setScale(double value)
static std::vector< std::string > getArrivedPersonIDList()
static void clearPending(const std::string &routeID="")
static void executeMove()
Advances a "half" step.
static bool hasGUI()
whether we run with graphical user interface (sumo-gui)
static void load(const std::vector< std::string > &args)
load a simulation with the given arguments
static double loadState(const std::string &fileName)
quick-load simulation state from file and return the state time
static std::vector< std::string > getEmergencyStoppingVehiclesIDList()
static std::vector< std::string > getLoadedIDList()
static const std::pair< std::string, std::string > getParameterWithKey(const std::string &objectID, const std::string &key)
static int getStopStartingVehiclesNumber()
static int getStartingTeleportNumber()
static bool isLoaded()
return whether a simulation (network) is present
static int getStopEndingVehiclesNumber()
static double getDeltaT()
static libsumo::TraCIStage findRoute(const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0)
static double getDistance2D(double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false)
static void setParameter(const std::string &objectID, const std::string &key, const std::string &value)
static libsumo::TraCIPositionVector getNetBoundary()
static std::vector< std::string > getCollidingVehiclesIDList()
static int getDepartedPersonNumber()
static int getBusStopWaiting(const std::string &stopID)
static std::pair< int, std::string > start(const std::vector< std::string > &cmd, int port=-1, int numRetries=libsumo::DEFAULT_NUM_RETRIES, const std::string &label="default", const bool verbose=false, const std::string &traceFile="", bool traceGetters=true, void *_stdout=nullptr)
static std::vector< std::string > getBusStopIDList()
static libsumo::TraCIPosition convert3D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
static int getCurrentTime()
static libsumo::TraCIPosition convertGeo(double x, double y, bool fromGeo=false)
static std::vector< std::string > getStartingTeleportIDList()
static void step(const double time=0.)
Advances by one step (or up to the given time)
Simulation()=delete
invalidated standard constructor
static std::vector< std::string > getArrivedIDList()
static double getDistanceRoad(const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false)
static std::vector< std::string > getParkingStartingVehiclesIDList()
static std::vector< std::string > getEndingTeleportIDList()
static int getMinExpectedNumber()
static ContextSubscriptionResults myContextSubscriptionResults
static std::pair< int, std::string > getVersion()
return TraCI API and SUMO version
static std::vector< std::string > getPendingVehicles()
static int getArrivedNumber()
static void writeMessage(const std::string &msg)
static void subscribe(const std::vector< int > &varIDs=std::vector< int >({-1}), double begin=libsumo::INVALID_DOUBLE_VALUE, double end=libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults ¶ms=libsumo::TraCIResults())
static int getEndingTeleportNumber()
static std::string getParameter(const std::string &objectID, const std::string &key)
static std::vector< std::string > getDepartedPersonIDList()
static std::vector< std::string > getBusStopWaitingIDList(const std::string &stopID)
Returns the IDs of the transportables on a given bus stop.
static int getLoadedNumber()
static std::vector< std::string > getStopEndingVehiclesIDList()
static int getParkingStartingVehiclesNumber()
static std::vector< std::string > getStopStartingVehiclesIDList()
static libsumo::TraCIPosition convert2D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
static std::vector< libsumo::TraCICollision > getCollisions()
static std::string getOption(const std::string &option)
return the SUMO option value
static int getCollidingVehiclesNumber()
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int DEFAULT_NUM_RETRIES
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.
An edgeId, position and laneIndex.