![]() |
SUMO - Simulation of Urban MObility
|
APIs for getting/setting simulation values via TraCI. More...
#include <TraCIServerAPI_Simulation.h>
Static Public Member Functions | |
static bool | commandDistanceRequest (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId) |
static bool | commandPositionConversion (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId) |
static std::pair< MSLane *, double > | convertCartesianToRoadMap (Position pos) |
static bool | processGet (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage) |
Processes a get value command (Command 0xab: Get Simulation Variable) More... | |
static bool | processSet (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage) |
Processes a set value command (Command 0xcb: Set Simulation Variable) More... | |
Private Member Functions | |
TraCIServerAPI_Simulation & | operator= (const TraCIServerAPI_Simulation &s) |
invalidated assignment operator More... | |
TraCIServerAPI_Simulation (const TraCIServerAPI_Simulation &s) | |
invalidated copy constructor More... | |
Static Private Member Functions | |
static void | writeStage (tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage) |
static void | writeVehicleStateIDs (TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state) |
static void | writeVehicleStateNumber (TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state) |
APIs for getting/setting simulation values via TraCI.
Definition at line 49 of file TraCIServerAPI_Simulation.h.
|
private |
invalidated copy constructor
|
static |
Definition at line 494 of file TraCIServerAPI_Simulation.cpp.
References SUMOAbstractRouter< E, V >::compute(), convertCartesianToRoadMap(), Position::distanceTo(), MSNet::getCurrentTimeStep(), MSRoute::getDistanceBetween(), MSNet::getInstance(), libsumo::Helper::getLaneChecking(), MSNet::getRouterTT(), POSITION_2D, POSITION_3D, POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), REQUEST_DRIVINGDIST, RTYPE_ERR, Position::set(), TYPE_DOUBLE, tcpip::Storage::writeDouble(), TraCIServer::writeStatusCmd(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().
|
static |
Converts a road map position to a cartesian position
pos | road map position that is to be convertes |
Definition at line 401 of file TraCIServerAPI_Simulation.cpp.
References GeoConvHelper::cartesian2geo(), convertCartesianToRoadMap(), GeoConvHelper::getFinal(), libsumo::Helper::getLaneChecking(), MSLane::getShape(), POSITION_2D, POSITION_3D, POSITION_LON_LAT, POSITION_LON_LAT_ALT, POSITION_ROADMAP, PositionVector::positionAtOffset(), tcpip::Storage::readDouble(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingUnsignedByte(), tcpip::Storage::readUnsignedByte(), RTYPE_ERR, Position::set(), tcpip::Storage::writeDouble(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeUnsignedByte(), Position::x(), GeoConvHelper::x2cartesian_const(), Position::y(), and Position::z().
Referenced by processGet().
|
static |
Converts a cartesian position to the closest road map position
pos | cartesian position that is to be converted |
Definition at line 378 of file TraCIServerAPI_Simulation.cpp.
References MSEdge::dictionary(), MSNet::getEdgeControl(), MSEdgeControl::getEdgeNames(), and MSNet::getInstance().
Referenced by commandDistanceRequest(), and commandPositionConversion().
|
private |
invalidated assignment operator
|
static |
Processes a get value command (Command 0xab: Get Simulation Variable)
[in] | server | The TraCI-server-instance which schedules this request |
[in] | inputStorage | The storage to read the command from |
[out] | outputStorage | The storage to write the result to |
Definition at line 56 of file TraCIServerAPI_Simulation.cpp.
References CMD_GET_SIM_VARIABLE, commandDistanceRequest(), commandPositionConversion(), DISTANCE_REQUEST, FIND_INTERMODAL_ROUTE, FIND_ROUTE, libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), libsumo::Simulation::getCurrentTime(), libsumo::Simulation::getDeltaT(), MSNet::getInstance(), libsumo::Simulation::getMinExpectedNumber(), libsumo::Simulation::getNetBoundary(), libsumo::Simulation::getParameter(), MSNet::getStoppingPlace(), MSStoppingPlace::getTransportableNumber(), POSITION_CONVERSION, tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), RESPONSE_GET_SIM_VARIABLE, RTYPE_OK, SUMO_TAG_BUS_STOP, TIME2STEPS, toHex(), TYPE_BOUNDINGBOX, TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRING, VAR_ARRIVED_VEHICLES_IDS, VAR_ARRIVED_VEHICLES_NUMBER, VAR_BUS_STOP_WAITING, VAR_DELTA_T, VAR_DEPARTED_VEHICLES_IDS, VAR_DEPARTED_VEHICLES_NUMBER, VAR_LOADED_VEHICLES_IDS, VAR_LOADED_VEHICLES_NUMBER, VAR_MIN_EXPECTED_VEHICLES, VAR_NET_BOUNDING_BOX, VAR_PARAMETER, VAR_PARKING_ENDING_VEHICLES_IDS, VAR_PARKING_ENDING_VEHICLES_NUMBER, VAR_PARKING_STARTING_VEHICLES_IDS, VAR_PARKING_STARTING_VEHICLES_NUMBER, VAR_STOP_ENDING_VEHICLES_IDS, VAR_STOP_ENDING_VEHICLES_NUMBER, VAR_STOP_STARTING_VEHICLES_IDS, VAR_STOP_STARTING_VEHICLES_NUMBER, VAR_TELEPORT_ENDING_VEHICLES_IDS, VAR_TELEPORT_ENDING_VEHICLES_NUMBER, VAR_TELEPORT_STARTING_VEHICLES_IDS, VAR_TELEPORT_STARTING_VEHICLES_NUMBER, VAR_TIME_STEP, MSNet::VEHICLE_STATE_ARRIVED, MSNet::VEHICLE_STATE_BUILT, MSNet::VEHICLE_STATE_DEPARTED, MSNet::VEHICLE_STATE_ENDING_PARKING, MSNet::VEHICLE_STATE_ENDING_STOP, MSNet::VEHICLE_STATE_ENDING_TELEPORT, MSNet::VEHICLE_STATE_STARTING_PARKING, MSNet::VEHICLE_STATE_STARTING_STOP, MSNet::VEHICLE_STATE_STARTING_TELEPORT, tcpip::Storage::writeDouble(), TraCIServer::writeErrorStatusCmd(), tcpip::Storage::writeInt(), TraCIServer::writeResponseWithLength(), writeStage(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeUnsignedByte(), writeVehicleStateIDs(), writeVehicleStateNumber(), libsumo::TraCIBoundary::xMax, libsumo::TraCIBoundary::xMin, libsumo::TraCIBoundary::yMax, and libsumo::TraCIBoundary::yMin.
Referenced by TraCIServer::TraCIServer().
|
static |
Processes a set value command (Command 0xcb: Set Simulation Variable)
[in] | server | The TraCI-server-instance which schedules this request |
[in] | inputStorage | The storage to read the command from |
[out] | outputStorage | The storage to write the result to |
Definition at line 299 of file TraCIServerAPI_Simulation.cpp.
References MSInsertionControl::clearPendingVehicles(), CMD_CLEAR_PENDING_VEHICLES, CMD_GET_SIM_VARIABLE, CMD_SAVE_SIMSTATE, CMD_SET_SIM_VARIABLE, MSNet::getInsertionControl(), MSNet::getInstance(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), RTYPE_OK, MSStateHandler::saveState(), toHex(), TraCIServer::writeErrorStatusCmd(), and TraCIServer::writeStatusCmd().
Referenced by TraCIServer::TraCIServer().
|
staticprivate |
Definition at line 359 of file TraCIServerAPI_Simulation.cpp.
References libsumo::TraCIStage::cost, libsumo::TraCIStage::destStop, libsumo::TraCIStage::edges, libsumo::TraCIStage::line, libsumo::TraCIStage::travelTime, libsumo::TraCIStage::type, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, TYPE_STRINGLIST, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().
|
staticprivate |
Definition at line 351 of file TraCIServerAPI_Simulation.cpp.
References TraCIServer::getVehicleStateChanges(), TYPE_STRINGLIST, tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().
|
staticprivate |
Definition at line 343 of file TraCIServerAPI_Simulation.cpp.
References TraCIServer::getVehicleStateChanges(), TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().