Eclipse SUMO - Simulation of Urban MObility
LIBSUMO_NAMESPACE::Simulation Class Reference

C++ TraCI client API implementation. More...

#include <Simulation.h>

Static Public Member Functions

static void clearPending (const std::string &routeID="")
 
static void close (const std::string &reason="Libsumo requested termination.")
 close simulation More...
 
static libsumo::TraCIPosition convert2D (const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
 
static libsumo::TraCIPosition convert3D (const std::string &edgeID, double pos, int laneIndex=0, bool toGeo=false)
 
static libsumo::TraCIPosition convertGeo (double x, double y, bool fromGeo=false)
 
static libsumo::TraCIRoadPosition convertRoad (double x, double y, bool isGeo=false, const std::string &vClass="ignoring")
 
static std::vector< libsumo::TraCIStagefindIntermodalRoute (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 libsumo::TraCIStage findRoute (const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0)
 
static const ContextSubscriptionResults getAllContextSubscriptionResults ()
 
static const SubscriptionResults getAllSubscriptionResults ()
 
static std::vector< std::string > getArrivedIDList ()
 
static int getArrivedNumber ()
 
static std::vector< std::string > getBusStopIDList ()
 
static int getBusStopWaiting (const std::string &stopID)
 
static std::vector< std::string > getBusStopWaitingIDList (const std::string &stopID)
 Returns the IDs of the transportables on a given bus stop. More...
 
static std::vector< std::string > getCollidingVehiclesIDList ()
 
static int getCollidingVehiclesNumber ()
 
static int getCurrentTime ()
 
static double getDeltaT ()
 
static std::vector< std::string > getDepartedIDList ()
 
static int getDepartedNumber ()
 
static double getDistance2D (double x1, double y1, double x2, double y2, bool isGeo=false, bool isDriving=false)
 
static double getDistanceRoad (const std::string &edgeID1, double pos1, const std::string &edgeID2, double pos2, bool isDriving=false)
 
static std::vector< std::string > getEmergencyStoppingVehiclesIDList ()
 
static int getEmergencyStoppingVehiclesNumber ()
 
static std::vector< std::string > getEndingTeleportIDList ()
 
static int getEndingTeleportNumber ()
 
static std::vector< std::string > getLoadedIDList ()
 
static int getLoadedNumber ()
 
static int getMinExpectedNumber ()
 
static libsumo::TraCIPositionVector getNetBoundary ()
 
static std::string getParameter (const std::string &objectID, const std::string &key)
 
static std::vector< std::string > getParkingEndingVehiclesIDList ()
 
static int getParkingEndingVehiclesNumber ()
 
static std::vector< std::string > getParkingStartingVehiclesIDList ()
 
static int getParkingStartingVehiclesNumber ()
 
static std::vector< std::string > getStartingTeleportIDList ()
 
static int getStartingTeleportNumber ()
 
static std::vector< std::string > getStopEndingVehiclesIDList ()
 
static int getStopEndingVehiclesNumber ()
 
static std::vector< std::string > getStopStartingVehiclesIDList ()
 
static int getStopStartingVehiclesNumber ()
 
static const libsumo::TraCIResults getSubscriptionResults ()
 
static double getTime ()
 
static std::pair< int, std::string > getVersion ()
 return TraCI API and SUMO version More...
 
static bool handleVariable (const std::string &objID, const int variable, VariableWrapper *wrapper)
 
static bool isLoaded ()
 return whether a simulation (network) is present More...
 
static void load (const std::vector< std::string > &args)
 load a simulation with the given arguments More...
 
static double loadState (const std::string &fileName)
 quick-load simulation state from file and return the state time More...
 
static std::shared_ptr< VariableWrapper > makeWrapper ()
 
static void saveState (const std::string &fileName)
 
static void step (const double time=0.)
 Advances by one step (or up to the given time) More...
 
static void subscribe (const std::vector< int > &varIDs=std::vector< int >(), double begin=libsumo::INVALID_DOUBLE_VALUE, double end=libsumo::INVALID_DOUBLE_VALUE)
 
static void writeMessage (const std::string &msg)
 

Private Member Functions

 Simulation ()=delete
 invalidated standard constructor More...
 

Static Private Attributes

static ContextSubscriptionResults myContextSubscriptionResults
 
static SubscriptionResults mySubscriptionResults
 

Detailed Description

C++ TraCI client API implementation.

Definition at line 45 of file Simulation.h.

Constructor & Destructor Documentation

◆ Simulation()

LIBSUMO_NAMESPACE::Simulation::Simulation ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ clearPending()

void libtraci::Simulation::clearPending ( const std::string &  routeID = "")
static

◆ close()

void libtraci::Simulation::close ( const std::string &  reason = "Libsumo requested termination.")
static

◆ convert2D()

TraCIPosition libsumo::Simulation::convert2D ( const std::string &  edgeID,
double  pos,
int  laneIndex = 0,
bool  toGeo = false 
)
static

◆ convert3D()

TraCIPosition libsumo::Simulation::convert3D ( const std::string &  edgeID,
double  pos,
int  laneIndex = 0,
bool  toGeo = false 
)
static

◆ convertGeo()

TraCIPosition libsumo::Simulation::convertGeo ( double  x,
double  y,
bool  fromGeo = false 
)
static

◆ convertRoad()

TraCIRoadPosition libsumo::Simulation::convertRoad ( double  x,
double  y,
bool  isGeo = false,
const std::string &  vClass = "ignoring" 
)
static

◆ findIntermodalRoute()

std::vector< TraCIStage > libsumo::Simulation::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

◆ findRoute()

◆ getAllContextSubscriptionResults()

const ContextSubscriptionResults libsumo::Simulation::getAllContextSubscriptionResults ( )
static

Definition at line 140 of file libsumo/Simulation.cpp.

◆ getAllSubscriptionResults()

const SubscriptionResults libsumo::Simulation::getAllSubscriptionResults ( )
static

Definition at line 134 of file libsumo/Simulation.cpp.

◆ getArrivedIDList()

std::vector< std::string > libtraci::Simulation::getArrivedIDList ( )
static

◆ getArrivedNumber()

int libtraci::Simulation::getArrivedNumber ( )
static

◆ getBusStopIDList()

std::vector< std::string > libtraci::Simulation::getBusStopIDList ( )
static

Definition at line 295 of file libsumo/Simulation.cpp.

References MSNet::getInstance(), and SUMO_TAG_BUS_STOP.

◆ getBusStopWaiting()

int libtraci::Simulation::getBusStopWaiting ( const std::string &  stopID)
static

◆ getBusStopWaitingIDList()

std::vector< std::string > libtraci::Simulation::getBusStopWaitingIDList ( const std::string &  stopID)
static

Returns the IDs of the transportables on a given bus stop.

Definition at line 313 of file libsumo/Simulation.cpp.

References MSNet::getInstance(), MSNet::getStoppingPlace(), MSStoppingPlace::getTransportables(), and SUMO_TAG_BUS_STOP.

◆ getCollidingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getCollidingVehiclesIDList ( )
static

◆ getCollidingVehiclesNumber()

int libtraci::Simulation::getCollidingVehiclesNumber ( )
static

◆ getCurrentTime()

int libtraci::Simulation::getCurrentTime ( )
static

Definition at line 152 of file libsumo/Simulation.cpp.

References MSNet::getCurrentTimeStep(), and MSNet::getInstance().

◆ getDeltaT()

double libtraci::Simulation::getDeltaT ( )
static

Definition at line 328 of file libsumo/Simulation.cpp.

References TS.

◆ getDepartedIDList()

std::vector< std::string > libtraci::Simulation::getDepartedIDList ( )
static

◆ getDepartedNumber()

int libtraci::Simulation::getDepartedNumber ( )
static

◆ getDistance2D()

double libsumo::Simulation::getDistance2D ( double  x1,
double  y1,
double  x2,
double  y2,
bool  isGeo = false,
bool  isDriving = false 
)
static

◆ getDistanceRoad()

double libsumo::Simulation::getDistanceRoad ( const std::string &  edgeID1,
double  pos1,
const std::string &  edgeID2,
double  pos2,
bool  isDriving = false 
)
static

◆ getEmergencyStoppingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getEmergencyStoppingVehiclesIDList ( )
static

◆ getEmergencyStoppingVehiclesNumber()

int libtraci::Simulation::getEmergencyStoppingVehiclesNumber ( )
static

◆ getEndingTeleportIDList()

std::vector< std::string > libtraci::Simulation::getEndingTeleportIDList ( )
static

◆ getEndingTeleportNumber()

int libtraci::Simulation::getEndingTeleportNumber ( )
static

◆ getLoadedIDList()

std::vector< std::string > libtraci::Simulation::getLoadedIDList ( )
static

◆ getLoadedNumber()

int libtraci::Simulation::getLoadedNumber ( )
static

◆ getMinExpectedNumber()

◆ getNetBoundary()

◆ getParameter()

◆ getParkingEndingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getParkingEndingVehiclesIDList ( )
static

◆ getParkingEndingVehiclesNumber()

int libtraci::Simulation::getParkingEndingVehiclesNumber ( )
static

◆ getParkingStartingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getParkingStartingVehiclesIDList ( )
static

◆ getParkingStartingVehiclesNumber()

int libtraci::Simulation::getParkingStartingVehiclesNumber ( )
static

◆ getStartingTeleportIDList()

std::vector< std::string > libtraci::Simulation::getStartingTeleportIDList ( )
static

◆ getStartingTeleportNumber()

int libtraci::Simulation::getStartingTeleportNumber ( )
static

◆ getStopEndingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getStopEndingVehiclesIDList ( )
static

◆ getStopEndingVehiclesNumber()

int libtraci::Simulation::getStopEndingVehiclesNumber ( )
static

◆ getStopStartingVehiclesIDList()

std::vector< std::string > libtraci::Simulation::getStopStartingVehiclesIDList ( )
static

◆ getStopStartingVehiclesNumber()

int libtraci::Simulation::getStopStartingVehiclesNumber ( )
static

◆ getSubscriptionResults()

const TraCIResults libsumo::Simulation::getSubscriptionResults ( )
static

Definition at line 128 of file libsumo/Simulation.cpp.

◆ getTime()

double libtraci::Simulation::getTime ( )
static

Definition at line 158 of file libsumo/Simulation.cpp.

References SIMTIME.

◆ getVersion()

std::pair< int, std::string > libtraci::Simulation::getVersion ( )
static

return TraCI API and SUMO version

Definition at line 146 of file libsumo/Simulation.cpp.

References libsumo::TRACI_VERSION.

◆ handleVariable()

◆ isLoaded()

bool libtraci::Simulation::isLoaded ( )
static

return whether a simulation (network) is present

Definition at line 89 of file libsumo/Simulation.cpp.

References MSNet::hasInstance().

◆ load()

void libtraci::Simulation::load ( const std::vector< std::string > &  args)
static

◆ loadState()

double libtraci::Simulation::loadState ( const std::string &  fileName)
static

◆ makeWrapper()

std::shared_ptr< VariableWrapper > libsumo::Simulation::makeWrapper ( )
static

Definition at line 734 of file libsumo/Simulation.cpp.

◆ saveState()

void libtraci::Simulation::saveState ( const std::string &  fileName)
static

Definition at line 702 of file libsumo/Simulation.cpp.

References MSNet::getInstance(), and MSStateHandler::saveState().

◆ step()

void libtraci::Simulation::step ( const double  time = 0.)
static

Advances by one step (or up to the given time)

Definition at line 95 of file libsumo/Simulation.cpp.

References libsumo::Helper::clearVehicleStates(), MSNet::getInstance(), libsumo::Helper::handleSubscriptions(), MSNet::simulationStep(), and TIME2STEPS.

◆ subscribe()

void libsumo::Simulation::subscribe ( const std::vector< int > &  varIDs = std::vector<int>(),
double  begin = libsumo::INVALID_DOUBLE_VALUE,
double  end = libsumo::INVALID_DOUBLE_VALUE 
)
static

◆ writeMessage()

void libtraci::Simulation::writeMessage ( const std::string &  msg)
static

Definition at line 728 of file libsumo/Simulation.cpp.

References WRITE_MESSAGE.

Field Documentation

◆ myContextSubscriptionResults

ContextSubscriptionResults libsumo::Simulation::myContextSubscriptionResults
staticprivate

Definition at line 167 of file Simulation.h.

◆ mySubscriptionResults

SubscriptionResults libsumo::Simulation::mySubscriptionResults
staticprivate

Definition at line 166 of file Simulation.h.


The documentation for this class was generated from the following files: