32 class VariableWrapper;
48 static std::pair<int, std::string> init(
int port = 8813,
int numRetries = 10,
const std::string& host =
"localhost",
const std::string& label =
"default", FILE*
const pipe =
nullptr);
50 static std::pair<int, std::string> start(
const std::vector<std::string>& cmd,
int port = -1,
int numRetries = 10,
const std::string& label =
"default",
const bool verbose =
false);
52 static bool isLibsumo();
57 static void switchConnection(
const std::string& label);
59 static const std::string& getLabel();
61 static void setOrder(
int order);
66 static void load(
const std::vector<std::string>& args);
72 static void step(
const double time = 0.);
75 static void close(
const std::string& reason =
"Libsumo requested termination.");
78 static std::pair<int, std::string>
getVersion();
131 static double getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo =
false,
bool isDriving =
false);
132 static double getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving =
false);
134 static libsumo::TraCIStage findRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& vType =
"",
const double depart = -1.,
const int routingMode = 0);
139 static std::vector<libsumo::TraCIStage>
findIntermodalRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& modes =
"",
140 double depart = -1.,
const int routingMode = 0,
double speed = -1.,
double walkFactor = -1.,
142 const std::string& pType =
"",
const std::string& vType =
"",
const std::string& destStop =
"");
144 static std::string
getParameter(
const std::string& objectID,
const std::string& key);
147 static void clearPending(
const std::string& routeID =
"");
148 static void saveState(
const std::string& fileName);
150 static double loadState(
const std::string& fileName);
159 static std::shared_ptr<VariableWrapper>
makeWrapper();
161 static bool handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper);
C++ TraCI client API implementation.
static std::vector< std::string > getDepartedIDList()
static libsumo::TraCIPosition convert2D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
static int getEmergencyStoppingVehiclesNumber()
static std::vector< std::string > getParkingEndingVehiclesIDList()
static int getParkingEndingVehiclesNumber()
static SubscriptionResults mySubscriptionResults
static int getDepartedNumber()
static void saveState(const std::string &fileName)
static void close(const std::string &reason="Libsumo requested termination.")
close simulation
static std::shared_ptr< VariableWrapper > makeWrapper()
static double getDistanceRoad(const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false)
static void clearPending(const std::string &routeID="")
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 int getStopStartingVehiclesNumber()
static int getStartingTeleportNumber()
static bool isLoaded()
return whether a simulation (network) is present
static int getStopEndingVehiclesNumber()
static double getDeltaT()
static const SubscriptionResults getAllSubscriptionResults()
static libsumo::TraCIPositionVector getNetBoundary()
static std::vector< std::string > getCollidingVehiclesIDList()
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 int getBusStopWaiting(const std::string &stopID)
static void subscribe(const std::vector< int > &varIDs=std::vector< int >(), double begin=libsumo::INVALID_DOUBLE_VALUE, double end=libsumo::INVALID_DOUBLE_VALUE)
static std::vector< std::string > getBusStopIDList()
static int getCurrentTime()
static libsumo::TraCIPosition convert3D(const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
static std::vector< std::string > getStartingTeleportIDList()
static void step(const double time=0.)
Advances by one step (or up to the given time)
static const ContextSubscriptionResults getAllContextSubscriptionResults()
static libsumo::TraCIRoadPosition convertRoad(double x, double y, bool isGeo=false, const std::string &vClass="ignoring")
static const libsumo::TraCIResults getSubscriptionResults()
Simulation()=delete
invalidated standard constructor
static std::vector< std::string > getArrivedIDList()
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 int getArrivedNumber()
static libsumo::TraCIPosition convertGeo(double x, double y, bool fromGeo=false)
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 void writeMessage(const std::string &msg)
static int getEndingTeleportNumber()
static std::string getParameter(const std::string &objectID, const std::string &key)
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 bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
static int getParkingStartingVehiclesNumber()
static std::vector< std::string > getStopStartingVehiclesIDList()
static double getDistance2D(double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false)
static int getCollidingVehiclesNumber()
TRACI_CONST double INVALID_DOUBLE_VALUE
std::map< int, std::shared_ptr< TraCIResult > > TraCIResults
{variable->value}
std::vector< TraCIPosition > TraCIPositionVector
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
An edgeId, position and laneIndex.