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 (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId) |
static bool | commandPositionConversion (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId) |
static std::pair< MSLane *, SUMOReal > | convertCartesianToRoadMap (Position pos) |
static const MSLane * | getLaneChecking (std::string roadID, int laneIndex, SUMOReal pos) |
static bool | processGet (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage) |
Processes a get value command (Command 0xaa: Get Edge Variable) | |
Private Member Functions | |
TraCIServerAPI_Simulation & | operator= (const TraCIServerAPI_Simulation &s) |
invalidated assignment operator | |
TraCIServerAPI_Simulation (const TraCIServerAPI_Simulation &s) | |
invalidated copy constructor |
APIs for getting/setting simulation values via TraCI.
Definition at line 51 of file TraCIServerAPI_Simulation.h.
TraCIServerAPI_Simulation::TraCIServerAPI_Simulation | ( | const TraCIServerAPI_Simulation & | s | ) | [private] |
invalidated copy constructor
bool TraCIServerAPI_Simulation::commandDistanceRequest | ( | traci::TraCIServer & | server, |
tcpip::Storage & | inputStorage, | ||
tcpip::Storage & | outputStorage, | ||
int | commandId | ||
) | [static] |
Definition at line 365 of file TraCIServerAPI_Simulation.cpp.
References CMD_DISTANCEREQUEST, TraCIDijkstraRouter< E >::compute(), RGBColor::DEFAULT_COLOR, MSEdge::dictSize(), Position::distanceTo(), MSNet::getCurrentTimeStep(), MSRoute::getDistanceBetween(), MSNet::getInstance(), POSITION_2D, POSITION_3D, POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), REQUEST_AIRDIST, REQUEST_DRIVINGDIST, RTYPE_ERR, Position::set(), SUMOReal, TYPE_DOUBLE, tcpip::Storage::writeDouble(), traci::TraCIServer::writeStatusCmd(), and tcpip::Storage::writeUnsignedByte().
Referenced by traci::TraCIServer::dispatchCommand().
bool TraCIServerAPI_Simulation::commandPositionConversion | ( | traci::TraCIServer & | server, |
tcpip::Storage & | inputStorage, | ||
tcpip::Storage & | outputStorage, | ||
int | commandId | ||
) | [static] |
Definition at line 251 of file TraCIServerAPI_Simulation.cpp.
References GeoConvHelper::cartesian2geo(), CMD_POSITIONCONVERSION, GeoConvHelper::getFinal(), POSITION_2D, POSITION_3D, POSITION_LAT_LON, POSITION_LAT_LON_ALT, POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), RTYPE_ERR, Position::set(), tcpip::Storage::size(), SUMOReal, tcpip::Storage::writeDouble(), traci::TraCIServer::writeStatusCmd(), tcpip::Storage::writeStorage(), tcpip::Storage::writeString(), tcpip::Storage::writeUnsignedByte(), Position::x(), GeoConvHelper::x2cartesian_const(), and Position::y().
Referenced by traci::TraCIServer::dispatchCommand().
std::pair< MSLane *, SUMOReal > TraCIServerAPI_Simulation::convertCartesianToRoadMap | ( | Position | pos | ) | [static] |
Converts a cartesian position to the closest road map position
pos | cartesian position that is to be converted |
Definition at line 211 of file TraCIServerAPI_Simulation.cpp.
References MSEdge::dictionary(), MSNet::getEdgeControl(), MSEdgeControl::getEdgeNames(), MSNet::getInstance(), max, and SUMOReal.
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest().
const MSLane * TraCIServerAPI_Simulation::getLaneChecking | ( | std::string | roadID, |
int | laneIndex, | ||
SUMOReal | pos | ||
) | [static] |
Converts a road map position to a cartesian position
pos | road map position that is to be convertes |
Definition at line 234 of file TraCIServerAPI_Simulation.cpp.
References MSEdge::dictionary(), MSEdge::getLanes(), and MSLane::getLength().
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest().
TraCIServerAPI_Simulation& TraCIServerAPI_Simulation::operator= | ( | const TraCIServerAPI_Simulation & | s | ) | [private] |
invalidated assignment operator
bool TraCIServerAPI_Simulation::processGet | ( | traci::TraCIServer & | server, |
tcpip::Storage & | inputStorage, | ||
tcpip::Storage & | outputStorage | ||
) | [static] |
Processes a get value command (Command 0xaa: Get Edge 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 63 of file TraCIServerAPI_Simulation.cpp.
References CMD_GET_SIM_VARIABLE, DELTA_T, DISTANCE_REQUEST, GeoConvHelper::getConvBoundary(), GeoConvHelper::getFinal(), MSNet::getInstance(), traci::TraCIServer::getVehicleStateChanges(), POSITION_CONVERSION, tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), RESPONSE_GET_SIM_VARIABLE, RTYPE_ERR, RTYPE_OK, TYPE_BOUNDINGBOX, TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRINGLIST, VAR_ARRIVED_VEHICLES_IDS, VAR_ARRIVED_VEHICLES_NUMBER, 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_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_TELEPORT, MSNet::VEHICLE_STATE_STARTING_TELEPORT, tcpip::Storage::writeDouble(), tcpip::Storage::writeInt(), traci::TraCIServer::writeResponseWithLength(), traci::TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), tcpip::Storage::writeUnsignedByte(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by traci::TraCIServer::TraCIServer().