SUMO - Simulation of Urban MObility
TraCIServerAPI_Simulation Class Reference

APIs for getting/setting simulation values via TraCI. More...

#include <TraCIServerAPI_Simulation.h>

Collaboration diagram for TraCIServerAPI_Simulation:
Collaboration graph

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...
 
static void writeVehicleStateIDs (TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
 
static void writeVehicleStateNumber (TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
 

Private Member Functions

TraCIServerAPI_Simulationoperator= (const TraCIServerAPI_Simulation &s)
 invalidated assignment operator More...
 
 TraCIServerAPI_Simulation (const TraCIServerAPI_Simulation &s)
 invalidated copy constructor More...
 

Detailed Description

APIs for getting/setting simulation values via TraCI.

Definition at line 51 of file TraCIServerAPI_Simulation.h.

Constructor & Destructor Documentation

◆ TraCIServerAPI_Simulation()

TraCIServerAPI_Simulation::TraCIServerAPI_Simulation ( const TraCIServerAPI_Simulation s)
private

invalidated copy constructor

Member Function Documentation

◆ commandDistanceRequest()

◆ commandPositionConversion()

◆ convertCartesianToRoadMap()

std::pair< MSLane *, double > TraCIServerAPI_Simulation::convertCartesianToRoadMap ( Position  pos)
static

Converts a cartesian position to the closest road map position

Parameters
poscartesian position that is to be converted
Returns
the closest road map position to the cartesian position

Definition at line 265 of file TraCIServerAPI_Simulation.cpp.

References MSEdge::dictionary(), MSNet::getEdgeControl(), MSEdgeControl::getEdgeNames(), MSNet::getInstance(), and max.

Referenced by commandDistanceRequest(), and commandPositionConversion().

◆ operator=()

TraCIServerAPI_Simulation& TraCIServerAPI_Simulation::operator= ( const TraCIServerAPI_Simulation s)
private

invalidated assignment operator

◆ processGet()

bool TraCIServerAPI_Simulation::processGet ( TraCIServer server,
tcpip::Storage inputStorage,
tcpip::Storage outputStorage 
)
static

Processes a get value command (Command 0xab: Get Simulation Variable)

Parameters
[in]serverThe TraCI-server-instance which schedules this request
[in]inputStorageThe storage to read the command from
[out]outputStorageThe storage to write the result to

Definition at line 54 of file TraCIServerAPI_Simulation.cpp.

References CMD_GET_SIM_VARIABLE, commandDistanceRequest(), commandPositionConversion(), DELTA_T, DISTANCE_REQUEST, MSNet::getBusStop(), GeoConvHelper::getConvBoundary(), GeoConvHelper::getFinal(), MSNet::getInstance(), MSStoppingPlace::getTransportableNumber(), TraCIServer::getVehicleStateChanges(), POSITION_CONVERSION, tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), RESPONSE_GET_SIM_VARIABLE, RTYPE_OK, toHex(), TYPE_BOUNDINGBOX, TYPE_COMPOUND, TYPE_INTEGER, TYPE_STRINGLIST, 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_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(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), tcpip::Storage::writeUnsignedByte(), writeVehicleStateIDs(), writeVehicleStateNumber(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by TraCIServer::TraCIServer().

◆ processSet()

bool TraCIServerAPI_Simulation::processSet ( TraCIServer server,
tcpip::Storage inputStorage,
tcpip::Storage outputStorage 
)
static

Processes a set value command (Command 0xcb: Set Simulation Variable)

Parameters
[in]serverThe TraCI-server-instance which schedules this request
[in]inputStorageThe storage to read the command from
[out]outputStorageThe storage to write the result to

Definition at line 209 of file TraCIServerAPI_Simulation.cpp.

References MSInsertionControl::clearPendingVehicles(), CMD_CLEAR_PENDING_VEHICLES, 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().

◆ writeVehicleStateIDs()

void TraCIServerAPI_Simulation::writeVehicleStateIDs ( TraCIServer server,
tcpip::Storage outputStorage,
MSNet::VehicleState  state 
)
static

◆ writeVehicleStateNumber()

void TraCIServerAPI_Simulation::writeVehicleStateNumber ( TraCIServer server,
tcpip::Storage outputStorage,
MSNet::VehicleState  state 
)
static

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