![]() |
Eclipse SUMO - Simulation of Urban MObility
|
APIs for getting/setting simulation values via TraCI. More...
#include <TraCIServerAPI_Simulation.h>
Static Public Member Functions | |
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... | |
static libsumo::TraCIStage * | readStage (TraCIServer &server, tcpip::Storage &inputStorage) |
static void | writeStage (tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage) |
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 bool | commandDistanceRequest (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId) |
static bool | commandPositionConversion (TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId) |
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 38 of file TraCIServerAPI_Simulation.h.
|
private |
invalidated copy constructor
|
staticprivate |
Definition at line 544 of file TraCIServerAPI_Simulation.cpp.
References libsumo::Helper::convertCartesianToRoadMap(), Position::distanceTo(), libsumo::Helper::getDrivingDistance(), libsumo::Helper::getLaneChecking(), libsumo::POSITION_2D, libsumo::POSITION_3D, libsumo::POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), libsumo::REQUEST_DRIVINGDIST, libsumo::RTYPE_ERR, Position::set(), SVC_IGNORING, libsumo::TYPE_DOUBLE, tcpip::Storage::writeDouble(), TraCIServer::writeStatusCmd(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().
|
staticprivate |
Converts a road map position to a cartesian position
pos | road map position that is to be convertes |
Definition at line 437 of file TraCIServerAPI_Simulation.cpp.
References GeoConvHelper::cartesian2geo(), libsumo::Helper::convertCartesianToRoadMap(), MSLane::geometryPositionAtOffset(), GeoConvHelper::getFinal(), libsumo::Helper::getLaneChecking(), libsumo::POSITION_2D, libsumo::POSITION_3D, libsumo::POSITION_LON_LAT, libsumo::POSITION_LON_LAT_ALT, libsumo::POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingUnsignedByte(), tcpip::Storage::readUnsignedByte(), libsumo::RTYPE_ERR, Position::set(), SumoVehicleClassStrings, SVC_IGNORING, tcpip::Storage::writeDouble(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeUnsignedByte(), Position::x(), GeoConvHelper::x2cartesian_const(), Position::y(), and Position::z().
Referenced by processGet().
|
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 |
length
Definition at line 46 of file TraCIServerAPI_Simulation.cpp.
References libsumo::CMD_GET_SIM_VARIABLE, commandDistanceRequest(), commandPositionConversion(), libsumo::DISTANCE_REQUEST, libsumo::FIND_INTERMODAL_ROUTE, libsumo::FIND_ROUTE, TraCIServer::getWrapperStorage(), TraCIServer::initWrapper(), libsumo::POSITION_CONVERSION, tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), libsumo::RESPONSE_GET_SIM_VARIABLE, libsumo::RTYPE_OK, SIMTIME, toHex(), libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_POLYGON, libsumo::TYPE_STRING, 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_VEHICLES_IDS, libsumo::VAR_DEPARTED_VEHICLES_NUMBER, libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_IDS, libsumo::VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER, libsumo::VAR_LOADED_VEHICLES_IDS, libsumo::VAR_LOADED_VEHICLES_NUMBER, libsumo::VAR_MIN_EXPECTED_VEHICLES, libsumo::VAR_NET_BOUNDING_BOX, libsumo::VAR_PARAMETER, libsumo::VAR_PARAMETER_WITH_KEY, libsumo::VAR_PARKING_ENDING_VEHICLES_IDS, libsumo::VAR_PARKING_ENDING_VEHICLES_NUMBER, libsumo::VAR_PARKING_MANEUVERING_VEHICLES_IDS, libsumo::VAR_PARKING_MANEUVERING_VEHICLES_NUMBER, libsumo::VAR_PARKING_STARTING_VEHICLES_IDS, libsumo::VAR_PARKING_STARTING_VEHICLES_NUMBER, 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, libsumo::VAR_TIME_STEP, MSNet::VEHICLE_STATE_ARRIVED, MSNet::VEHICLE_STATE_BUILT, MSNet::VEHICLE_STATE_COLLISION, MSNet::VEHICLE_STATE_DEPARTED, MSNet::VEHICLE_STATE_EMERGENCYSTOP, MSNet::VEHICLE_STATE_ENDING_PARKING, MSNet::VEHICLE_STATE_ENDING_STOP, MSNet::VEHICLE_STATE_ENDING_TELEPORT, MSNet::VEHICLE_STATE_MANEUVERING, MSNet::VEHICLE_STATE_STARTING_PARKING, MSNet::VEHICLE_STATE_STARTING_STOP, MSNet::VEHICLE_STATE_STARTING_TELEPORT, TraCIServer::wrapStringList(), tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), TraCIServer::writeErrorStatusCmd(), tcpip::Storage::writeInt(), TraCIServer::writeResponseWithLength(), writeStage(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeUnsignedByte(), writeVehicleStateIDs(), and writeVehicleStateNumber().
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 305 of file TraCIServerAPI_Simulation.cpp.
References libsumo::CMD_CLEAR_PENDING_VEHICLES, libsumo::CMD_GET_SIM_VARIABLE, libsumo::CMD_LOAD_SIMSTATE, libsumo::CMD_MESSAGE, libsumo::CMD_SAVE_SIMSTATE, libsumo::CMD_SET_SIM_VARIABLE, TraCIServer::getInstance(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), libsumo::RTYPE_OK, TraCIServer::stateLoaded(), TIME2STEPS, toHex(), TraCIServer::writeErrorStatusCmd(), and TraCIServer::writeStatusCmd().
Referenced by TraCIServer::TraCIServer().
|
static |
Definition at line 418 of file TraCIServerAPI_Simulation.cpp.
References TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), and TraCIServer::readTypeCheckingStringList().
Referenced by TraCIServerAPI_Person::processSet().
|
static |
Definition at line 386 of file TraCIServerAPI_Simulation.cpp.
References libsumo::TraCIStage::arrivalPos, libsumo::TraCIStage::cost, libsumo::TraCIStage::depart, libsumo::TraCIStage::departPos, libsumo::TraCIStage::description, libsumo::TraCIStage::destStop, libsumo::TraCIStage::edges, libsumo::TraCIStage::intended, libsumo::TraCIStage::length, libsumo::TraCIStage::line, libsumo::TraCIStage::travelTime, libsumo::TraCIStage::type, libsumo::TYPE_COMPOUND, libsumo::TYPE_DOUBLE, libsumo::TYPE_INTEGER, libsumo::TYPE_STRING, libsumo::TYPE_STRINGLIST, libsumo::TraCIStage::vType, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by TraCIServerAPI_Person::processGet(), and processGet().
|
staticprivate |
Definition at line 378 of file TraCIServerAPI_Simulation.cpp.
References TraCIServer::getVehicleStateChanges(), libsumo::TYPE_STRINGLIST, tcpip::Storage::writeStringList(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().
|
staticprivate |
Definition at line 370 of file TraCIServerAPI_Simulation.cpp.
References TraCIServer::getVehicleStateChanges(), libsumo::TYPE_INTEGER, tcpip::Storage::writeInt(), and tcpip::Storage::writeUnsignedByte().
Referenced by processGet().