45 const std::string& host =
"localhost",
const std::string& label =
"default", FILE*
const pipe =
nullptr);
48 const std::string& label =
"default",
const bool verbose =
false,
49 const std::string& traceFile =
"",
bool traceGetters =
true,
void* _stdout =
nullptr);
58 static const std::string&
getLabel();
64 static void load(
const std::vector<std::string>& args);
73 static void step(
const double time = 0.);
79 static void close(
const std::string& reason =
"Libsumo requested termination.");
82 static std::pair<int, std::string>
getVersion();
85 static std::string
getOption(
const std::string& option);
146 static double getDistance2D(
double x1,
double y1,
double x2,
double y2,
bool isGeo =
false,
bool isDriving =
false);
147 static double getDistanceRoad(
const std::string& edgeID1,
double pos1,
const std::string& edgeID2,
double pos2,
bool isDriving =
false);
149 static libsumo::TraCIStage findRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& vType =
"",
const double depart = -1.,
const int routingMode = 0);
154 static std::vector<libsumo::TraCIStage>
findIntermodalRoute(
const std::string& fromEdge,
const std::string& toEdge,
const std::string& modes =
"",
155 double depart = -1.,
const int routingMode = 0,
double speed = -1.,
double walkFactor = -1.,
157 const std::string& pType =
"",
const std::string& vType =
"",
const std::string& destStop =
"");
159 static std::string
getParameter(
const std::string& objectID,
const std::string& key);
160 static const std::pair<std::string, std::string>
getParameterWithKey(
const std::string& objectID,
const std::string& key);
161 static void setParameter(
const std::string& objectID,
const std::string& key,
const std::string& value);
164 static void clearPending(
const std::string& routeID =
"");
165 static void saveState(
const std::string& fileName);
167 static double loadState(
const std::string& fileName);
179 static std::shared_ptr<VariableWrapper> makeWrapper();
181 static bool handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData);
191 static FXMutex myStepMutex;
#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 const std::string & getLabel()
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 std::pair< int, std::string > init(int port=8813, int numRetries=libsumo::DEFAULT_NUM_RETRIES, const std::string &host="localhost", const std::string &label="default", FILE *const pipe=nullptr)
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_SUBSCRIPTION_API 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 ¶meters=libsumo::TraCIResults())
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 void setOrder(int order)
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 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 void switchConnection(const std::string &label)
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.