Eclipse SUMO - Simulation of Urban MObility
|
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 void | executeMove () |
Advances a "half" step. More... | |
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 libsumo::TraCIStage | findRoute (const std::string &fromEdge, const std::string &toEdge, const std::string &vType="", const double depart=-1., const int routingMode=0) |
static std::vector< std::string > | getArrivedIDList () |
static int | getArrivedNumber () |
static std::vector< std::string > | getArrivedPersonIDList () |
static int | getArrivedPersonNumber () |
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 std::vector< libsumo::TraCICollision > | getCollisions () |
static int | getCurrentTime () |
static double | getDeltaT () |
static std::vector< std::string > | getDepartedIDList () |
static int | getDepartedNumber () |
static std::vector< std::string > | getDepartedPersonIDList () |
static int | getDepartedPersonNumber () |
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 double | getEndTime () |
return configured end time More... | |
static std::vector< std::string > | getLoadedIDList () |
static int | getLoadedNumber () |
static int | getMinExpectedNumber () |
static libsumo::TraCIPositionVector | getNetBoundary () |
static std::string | getOption (const std::string &option) |
return the SUMO option value More... | |
static std::string | getParameter (const std::string &objectID, const std::string &key) |
static const std::pair< std::string, std::string > | getParameterWithKey (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 > | getPendingVehicles () |
static double | getScale () |
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, tcpip::Storage *paramData) |
static bool | hasGUI () |
whether we run with graphical user interface (sumo-gui) More... | |
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 | setParameter (const std::string &objectID, const std::string &key, const std::string &value) |
static void | setScale (double value) |
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 void | step (const double time=0.) |
Advances by one step (or up to the given time) More... | |
static LIBSUMO_SUBSCRIPTION_API void | storeShape (PositionVector &shape) |
static void | subscribe (const std::vector< int > &varIDs=std::vector< int >(), double begin=libsumo::INVALID_DOUBLE_VALUE, double end=libsumo::INVALID_DOUBLE_VALUE, const libsumo::TraCIResults ¶ms=libsumo::TraCIResults()) |
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 |
C++ TraCI client API implementation.
Definition at line 41 of file Simulation.h.
|
privatedelete |
invalidated standard constructor
|
static |
Definition at line 847 of file libsumo/Simulation.cpp.
References MSInsertionControl::clearPendingVehicles(), MSNet::getInsertionControl(), and MSNet::getInstance().
|
static |
close simulation
Definition at line 157 of file libsumo/Simulation.cpp.
References libsumo::Helper::clearSubscriptions(), SystemFrame::close(), MSNet::closeSimulation(), MSNet::getInstance(), and MSNet::hasInstance().
|
static |
Definition at line 476 of file libsumo/Simulation.cpp.
References GeoConvHelper::cartesian2geo(), MSLane::geometryPositionAtOffset(), GeoConvHelper::getFinal(), libsumo::Helper::getLaneChecking(), libsumo::Helper::makeTraCIPosition(), and Position::setz().
|
static |
Definition at line 487 of file libsumo/Simulation.cpp.
References GeoConvHelper::cartesian2geo(), MSLane::geometryPositionAtOffset(), GeoConvHelper::getFinal(), libsumo::Helper::getLaneChecking(), and libsumo::Helper::makeTraCIPosition().
|
static |
Definition at line 519 of file libsumo/Simulation.cpp.
References GeoConvHelper::cartesian2geo(), GeoConvHelper::getFinal(), libsumo::Helper::makeTraCIPosition(), and GeoConvHelper::x2cartesian_const().
|
static |
Definition at line 497 of file libsumo/Simulation.cpp.
References libsumo::Helper::convertCartesianToRoadMap(), GeoConvHelper::getFinal(), SumoVehicleClassStrings, and GeoConvHelper::x2cartesian_const().
|
static |
Advances a "half" step.
Definition at line 151 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), and MSNet::simulationStep().
|
static |
Definition at line 610 of file libsumo/Simulation.cpp.
References BICYCLE, MSVehicleControl::buildVehicle(), CAR, IntermodalRouter< E, L, N, V >::compute(), DEFAULT_BIKETYPE_ID, DEFAULT_PEDTYPE_ID, DEFAULT_TAXITYPE_ID, DEFAULT_VTYPE_ID, MSVehicleControl::deleteVehicle(), MSEdge::dictionary(), MSGlobals::gCheckRoutes, MSNet::getCurrentTimeStep(), MSVehicleType::getDesiredMaxSpeed(), OptionsCont::getFloat(), MSVehicleType::getID(), Named::getID(), MSNet::getInstance(), MSNet::getIntermodalRouter(), MSEdge::getLength(), MSVehicleType::getMaxSpeed(), OptionsCont::getOptions(), Distribution_Parameterized::getParameter(), MSVehicleType::getParameter(), Parameterised::getParameter(), MSEdge::getPermissions(), MSVehicleType::getSpeedFactor(), MSVehicleType::getVehicleClass(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), StringTokenizer::hasNext(), MSVehicleControl::hasVType(), libsumo::INVALID_DOUBLE_VALUE, MIN2(), PUBLIC, SUMOVehicle::setChosenSpeedFactor(), libsumo::STAGE_DRIVING, libsumo::STAGE_WALKING, SVC_BICYCLE, SVC_BUS, SVC_IGNORING, SVC_PASSENGER, SVC_TAXI, TAXI, TIME2STEPS, TL, StringUtils::toDouble(), toString(), UNUSED_PARAMETER, WALK, and WRITE_WARNINGF.
|
static |
Definition at line 563 of file libsumo/Simulation.cpp.
References MSVehicleControl::buildVehicle(), SUMOAbstractRouter< E, V >::compute(), DEFAULT_VTYPE_ID, MSVehicleControl::deleteVehicle(), MSEdge::dictionary(), MSNet::getCurrentTimeStep(), MSVehicleType::getID(), MSNet::getInstance(), Distribution_Parameterized::getParameter(), MSNet::getRouterTT(), MSRoutingEngine::getRouterTT(), MSVehicleType::getSpeedFactor(), MSBaseVehicle::getVClass(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), MSBaseVehicle::hasValidRouteStart(), SUMOVehicleParameter::id, SUMOAbstractRouter< E, V >::recomputeCosts(), libsumo::ROUTING_MODE_AGGREGATED, MSBaseVehicle::setChosenSpeedFactor(), MSBaseVehicle::setRoutingMode(), libsumo::STAGE_DRIVING, and TIME2STEPS.
|
static |
Definition at line 250 of file libsumo/Simulation.cpp.
References MSNet::ARRIVED, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 244 of file libsumo/Simulation.cpp.
References MSNet::ARRIVED, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 369 of file libsumo/Simulation.cpp.
References libsumo::Helper::getTransportableStateChanges(), and MSNet::PERSON_ARRIVED.
|
static |
Definition at line 363 of file libsumo/Simulation.cpp.
References libsumo::Helper::getTransportableStateChanges(), and MSNet::PERSON_ARRIVED.
|
static |
Definition at line 374 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), and SUMO_TAG_BUS_STOP.
|
static |
Definition at line 383 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), MSNet::getStoppingPlace(), MSStoppingPlace::getTransportableNumber(), and SUMO_TAG_BUS_STOP.
|
static |
Returns the IDs of the transportables on a given bus stop.
Definition at line 392 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), MSNet::getStoppingPlace(), MSStoppingPlace::getTransportables(), and SUMO_TAG_BUS_STOP.
|
static |
Definition at line 310 of file libsumo/Simulation.cpp.
References MSNet::COLLISION, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 304 of file libsumo/Simulation.cpp.
References MSNet::COLLISION, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 416 of file libsumo/Simulation.cpp.
References libsumo::TraCICollision::collider, libsumo::TraCICollision::colliderSpeed, MSNet::Collision::colliderSpeed, libsumo::TraCICollision::colliderType, MSNet::Collision::colliderType, Named::getID(), MSNet::getInstance(), libsumo::TraCICollision::lane, MSNet::Collision::lane, libsumo::TraCICollision::pos, MSNet::Collision::pos, libsumo::TraCICollision::type, MSNet::Collision::type, libsumo::TraCICollision::victim, MSNet::Collision::victim, libsumo::TraCICollision::victimSpeed, MSNet::Collision::victimSpeed, libsumo::TraCICollision::victimType, and MSNet::Collision::victimType.
|
static |
Definition at line 203 of file libsumo/Simulation.cpp.
References MSNet::getCurrentTimeStep(), and MSNet::getInstance().
|
static |
Definition at line 442 of file libsumo/Simulation.cpp.
References TS.
|
static |
Definition at line 238 of file libsumo/Simulation.cpp.
References MSNet::DEPARTED, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 232 of file libsumo/Simulation.cpp.
References MSNet::DEPARTED, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 357 of file libsumo/Simulation.cpp.
References libsumo::Helper::getTransportableStateChanges(), and MSNet::PERSON_DEPARTED.
|
static |
Definition at line 351 of file libsumo/Simulation.cpp.
References libsumo::Helper::getTransportableStateChanges(), and MSNet::PERSON_DEPARTED.
|
static |
Definition at line 531 of file libsumo/Simulation.cpp.
References libsumo::Helper::convertCartesianToRoadMap(), Position::distanceTo(), libsumo::Helper::getDrivingDistance(), GeoConvHelper::getFinal(), SVC_IGNORING, and GeoConvHelper::x2cartesian_const().
|
static |
Definition at line 549 of file libsumo/Simulation.cpp.
References Position::distanceTo(), libsumo::Helper::getDrivingDistance(), and libsumo::Helper::getLaneChecking().
|
static |
Definition at line 322 of file libsumo/Simulation.cpp.
References MSNet::EMERGENCYSTOP, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 316 of file libsumo/Simulation.cpp.
References MSNet::EMERGENCYSTOP, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 346 of file libsumo/Simulation.cpp.
References MSNet::ENDING_TELEPORT, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 340 of file libsumo/Simulation.cpp.
References MSNet::ENDING_TELEPORT, and libsumo::Helper::getVehicleStateChanges().
|
static |
return configured end time
Definition at line 214 of file libsumo/Simulation.cpp.
References OptionsCont::getOptions(), STEPS2TIME, and string2time().
|
static |
Definition at line 226 of file libsumo/Simulation.cpp.
References MSNet::BUILT, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 220 of file libsumo/Simulation.cpp.
References MSNet::BUILT, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 466 of file libsumo/Simulation.cpp.
References MSTransportableControl::getActiveCount(), MSVehicleControl::getActiveVehicleCount(), MSNet::getContainerControl(), MSNet::getInsertionControl(), MSNet::getInstance(), MSInsertionControl::getPendingFlowCount(), MSNet::getPersonControl(), MSNet::getVehicleControl(), MSNet::hasContainers(), and MSNet::hasPersons().
|
static |
Definition at line 448 of file libsumo/Simulation.cpp.
References GeoConvHelper::getConvBoundary(), GeoConvHelper::getFinal(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), Boundary::ymin(), Boundary::zmax(), and Boundary::zmin().
|
static |
return the SUMO option value
Definition at line 193 of file libsumo/Simulation.cpp.
References OptionsCont::exists(), OptionsCont::getOptions(), and OptionsCont::getValueString().
|
static |
Definition at line 743 of file libsumo/Simulation.cpp.
References MSParkingArea::getCapacity(), GeoConvHelper::getFinal(), MSDevice_Tripinfo::getGlobalParameter(), Named::getID(), MSNet::getInstance(), MSStoppingPlace::getLane(), MSStoppingPlace::getMyName(), MSParkingArea::getOccupancyIncludingBlocked(), GeoConvHelper::getOffsetBase(), Parameterised::getParameter(), MSNet::getStoppingPlace(), MSChargingStation::getTotalCharged(), MSOverheadWire::getTotalCharged(), Parameterised::hasParameter(), StringUtils::startsWith(), SUMO_ATTR_NAME, SUMO_ATTR_NET_OFFSET, SUMO_ATTR_TOTALENERGYCHARGED, SUMO_TAG_BUS_STOP, SUMO_TAG_CHARGING_STATION, SUMO_TAG_OVERHEAD_WIRE_SEGMENT, SUMO_TAG_PARKING_AREA, and toString().
|
static |
|
static |
Definition at line 274 of file libsumo/Simulation.cpp.
References MSNet::ENDING_PARKING, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 268 of file libsumo/Simulation.cpp.
References MSNet::ENDING_PARKING, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 262 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_PARKING.
|
static |
Definition at line 256 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_PARKING.
|
static |
Definition at line 406 of file libsumo/Simulation.cpp.
References MSNet::getInstance().
|
static |
Definition at line 437 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), MSVehicleControl::getScale(), and MSNet::getVehicleControl().
|
static |
Definition at line 334 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_TELEPORT.
|
static |
Definition at line 328 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_TELEPORT.
|
static |
Definition at line 298 of file libsumo/Simulation.cpp.
References MSNet::ENDING_STOP, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 292 of file libsumo/Simulation.cpp.
References MSNet::ENDING_STOP, and libsumo::Helper::getVehicleStateChanges().
|
static |
Definition at line 286 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_STOP.
|
static |
Definition at line 280 of file libsumo/Simulation.cpp.
References libsumo::Helper::getVehicleStateChanges(), and MSNet::STARTING_STOP.
|
static |
Definition at line 178 of file libsumo/Simulation.cpp.
|
static |
Definition at line 209 of file libsumo/Simulation.cpp.
References SIMTIME.
|
static |
return TraCI API and SUMO version
Definition at line 187 of file libsumo/Simulation.cpp.
References libsumo::TRACI_VERSION.
|
static |
Definition at line 892 of file libsumo/Simulation.cpp.
References tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), libsumo::VAR_ARRIVED_PERSONS_IDS, libsumo::VAR_ARRIVED_PERSONS_NUMBER, libsumo::VAR_ARRIVED_VEHICLES_IDS, libsumo::VAR_ARRIVED_VEHICLES_NUMBER, libsumo::VAR_BUS_STOP_ID_LIST, libsumo::VAR_BUS_STOP_WAITING, libsumo::VAR_BUS_STOP_WAITING_IDS, libsumo::VAR_COLLIDING_VEHICLES_IDS, libsumo::VAR_COLLIDING_VEHICLES_NUMBER, libsumo::VAR_DELTA_T, libsumo::VAR_DEPARTED_PERSONS_IDS, libsumo::VAR_DEPARTED_PERSONS_NUMBER, libsumo::VAR_DEPARTED_VEHICLES_IDS, libsumo::VAR_DEPARTED_VEHICLES_NUMBER, libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_IDS, libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER, libsumo::VAR_END, libsumo::VAR_LOADED_VEHICLES_IDS, libsumo::VAR_LOADED_VEHICLES_NUMBER, libsumo::VAR_MIN_EXPECTED_VEHICLES, libsumo::VAR_OPTION, libsumo::VAR_PARAMETER, libsumo::VAR_PARAMETER_WITH_KEY, libsumo::VAR_PARKING_ENDING_VEHICLES_IDS, libsumo::VAR_PARKING_ENDING_VEHICLES_NUMBER, libsumo::VAR_PARKING_STARTING_VEHICLES_IDS, libsumo::VAR_PARKING_STARTING_VEHICLES_NUMBER, libsumo::VAR_PENDING_VEHICLES, libsumo::VAR_SCALE, libsumo::VAR_STOP_ENDING_VEHICLES_IDS, libsumo::VAR_STOP_ENDING_VEHICLES_NUMBER, libsumo::VAR_STOP_STARTING_VEHICLES_IDS, libsumo::VAR_STOP_STARTING_VEHICLES_NUMBER, libsumo::VAR_TELEPORT_ENDING_VEHICLES_IDS, libsumo::VAR_TELEPORT_ENDING_VEHICLES_NUMBER, libsumo::VAR_TELEPORT_STARTING_VEHICLES_IDS, libsumo::VAR_TELEPORT_STARTING_VEHICLES_NUMBER, libsumo::VAR_TIME, and libsumo::VAR_TIME_STEP.
|
static |
whether we run with graphical user interface (sumo-gui)
Definition at line 114 of file libsumo/Simulation.cpp.
|
static |
return whether a simulation (network) is present
Definition at line 124 of file libsumo/Simulation.cpp.
References MSNet::hasInstance().
|
static |
load a simulation with the given arguments
Definition at line 90 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), OptionsCont::getOptions(), gSimulation, XMLSubSys::init(), NLBuilder::init(), OptionsCont::setApplicationName(), OptionsIO::setArgs(), MSNet::setCurrentTimeStep(), string2time(), time2string(), TL, and WRITE_MESSAGEF.
|
static |
quick-load simulation state from file and return the state time
Definition at line 858 of file libsumo/Simulation.cpp.
References libsumo::Helper::clearStateChanges(), libsumo::Helper::clearSubscriptions(), MSNet::getInstance(), MSNet::loadState(), PROGRESS_BEGIN_TIME_MESSAGE, PROGRESS_TIME_MESSAGE, and STEPS2TIME.
|
static |
Definition at line 886 of file libsumo/Simulation.cpp.
|
static |
Definition at line 853 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), and MSStateHandler::saveState().
|
static |
Definition at line 833 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), and Parameterised::setParameter().
|
static |
Definition at line 842 of file libsumo/Simulation.cpp.
References MSNet::getInstance(), MSNet::getVehicleControl(), and MSVehicleControl::setScale().
|
static |
Definition at line 77 of file libsumo/Simulation.cpp.
|
static |
Advances by one step (or up to the given time)
Definition at line 130 of file libsumo/Simulation.cpp.
References libsumo::Helper::clearStateChanges(), MSNet::getInstance(), libsumo::Helper::handleSubscriptions(), MSNet::simulationStep(), and TIME2STEPS.
|
static |
Definition at line 880 of file libsumo/Simulation.cpp.
References GeoConvHelper::getConvBoundary(), GeoConvHelper::getFinal(), and Boundary::getShape().
|
static |
Definition at line 172 of file libsumo/Simulation.cpp.
References libsumo::CMD_SUBSCRIBE_SIM_VARIABLE, and libsumo::Helper::subscribe().
|
static |
Definition at line 874 of file libsumo/Simulation.cpp.
References WRITE_MESSAGE.
|
staticprivate |
Definition at line 187 of file Simulation.h.
|
staticprivate |
Definition at line 186 of file Simulation.h.