SUMO - Simulation of Urban MObility
TraCIServerAPI_Person Class Reference

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

#include <TraCIServerAPI_Person.h>

Collaboration diagram for TraCIServerAPI_Person:
Collaboration graph

Static Public Member Functions

static bool getPosition (const std::string &id, Position &p)
 Returns the named persons's position. More...
 
static bool processGet (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
 Processes a get value command (Command 0xae: Get Person Variable) More...
 
static bool processSet (TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
 Processes a set value command (Command 0xce: Change Person State) More...
 

Private Member Functions

TraCIServerAPI_Personoperator= (const TraCIServerAPI_Person &s)
 invalidated assignment operator More...
 
 TraCIServerAPI_Person (const TraCIServerAPI_Person &s)
 invalidated copy constructor More...
 

Static Private Member Functions

static MSVehicleTypegetSingularType (MSTransportable *const t)
 

Detailed Description

APIs for getting/setting person values via TraCI.

Definition at line 51 of file TraCIServerAPI_Person.h.

Constructor & Destructor Documentation

◆ TraCIServerAPI_Person()

TraCIServerAPI_Person::TraCIServerAPI_Person ( const TraCIServerAPI_Person s)
private

invalidated copy constructor

Member Function Documentation

◆ getPosition()

bool TraCIServerAPI_Person::getPosition ( const std::string &  id,
Position p 
)
static

Returns the named persons's position.

Parameters
[in]idThe id of the searched person
[out]pThe position, if the person is on the network
Returns
Whether the person is known

Definition at line 509 of file TraCIServerAPI_Person.cpp.

References MSTransportableControl::get(), MSNet::getInstance(), MSNet::getPersonControl(), and MSTransportable::getPosition().

Referenced by TraCIServer::findObjectShape().

◆ getSingularType()

◆ operator=()

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

invalidated assignment operator

◆ processGet()

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

Processes a get value command (Command 0xae: Get Person 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 48 of file TraCIServerAPI_Person.cpp.

References RGBColor::alpha(), RGBColor::blue(), CMD_GET_PERSON_VARIABLE, SUMOVehicleParameter::color, MSTransportableControl::get(), MSTransportable::getAngle(), MSTransportable::getEdge(), MSTransportable::getEdgePos(), MSTransportable::getEdges(), Named::getID(), SUMOVehicle::getID(), MSVehicleType::getID(), MSNet::getInstance(), MSTransportable::getNumRemainingStages(), MSTransportable::getNumStages(), Parameterised::getParameter(), MSTransportable::getParameter(), MSNet::getPersonControl(), MSTransportable::getPosition(), MSTransportable::getSpeed(), MSTransportable::getStageType(), TraCIServerAPI_VehicleType::getVariable(), MSTransportable::getVehicle(), MSTransportable::getVehicleType(), MSTransportable::getWaitingSeconds(), RGBColor::green(), ID_COUNT, ID_LIST, MSTransportableControl::loadedBegin(), MSTransportableControl::loadedEnd(), GeomHelper::naviDegree(), POSITION_2D, POSITION_3D, tcpip::Storage::readString(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), RGBColor::red(), RESPONSE_GET_PERSON_VARIABLE, RTYPE_OK, MSTransportableControl::size(), toHex(), TYPE_COLOR, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, TYPE_STRINGLIST, VAR_ANGLE, VAR_COLOR, VAR_EDGES, VAR_LANEPOSITION, VAR_LENGTH, VAR_MINGAP, VAR_NEXT_EDGE, VAR_PARAMETER, VAR_POSITION, VAR_POSITION3D, VAR_ROAD_ID, VAR_SHAPECLASS, VAR_SPEED, VAR_STAGE, VAR_STAGES_REMAINING, VAR_TYPE, VAR_VEHICLE, VAR_WAITING_TIME, VAR_WIDTH, MSTransportable::WAITING_FOR_DEPART, tcpip::Storage::writeDouble(), TraCIServer::writeErrorStatusCmd(), tcpip::Storage::writeInt(), TraCIServer::writeResponseWithLength(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), tcpip::Storage::writeUnsignedByte(), Position::x(), Position::y(), and Position::z().

Referenced by TraCIServer::TraCIServer().

◆ processSet()

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

Processes a set value command (Command 0xce: Change Person State)

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 206 of file TraCIServerAPI_Person.cpp.

References MSTransportableControl::add(), ADD, APPEND_STAGE, MSTransportable::appendStage(), MSTransportableControl::buildPerson(), CMD_GET_PERSON_VARIABLE, CMD_SET_PERSON_VARIABLE, CMD_SET_VEHICLE_VARIABLE, SUMOVehicleParameter::depart, DEPART_DEF_MAX, DEPART_POS_GIVEN, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departPosProcedure, SUMOVehicleParameter::departProcedure, MSEdge::dictionary(), MSTransportable::DRIVING, MSTransportableControl::get(), MSTransportable::getArrivalEdge(), MSTransportable::getArrivalPos(), MSNet::getBusStop(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSEdge::getLength(), MSVehicleType::getMaxSpeed(), MSTransportable::getNumRemainingStages(), MSTransportable::getParameter(), MSNet::getPersonControl(), getSingularType(), MSNet::getVehicleControl(), MSTransportable::getVehicleType(), MSVehicleControl::getVType(), SUMOVehicleParameter::id, MSTransportable::MOVING_WITHOUT_VEHICLE, NUMERICAL_EPS, MSEdge::parseEdgesList(), tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), TraCIServer::readTypeCheckingStringList(), tcpip::Storage::readUnsignedByte(), REMOVE_STAGE, MSTransportable::removeStage(), MSTransportable::replaceVehicleType(), RTYPE_OK, MSTransportable::setSpeed(), TraCIServerAPI_VehicleType::setVariable(), toHex(), TYPE_COMPOUND, VAR_COLOR, VAR_HEIGHT, VAR_LENGTH, VAR_MINGAP, VAR_PARAMETER, VAR_SPEED, VAR_TYPE, VAR_WIDTH, MSTransportable::WAITING, WRITE_WARNING, TraCIServer::writeErrorStatusCmd(), and TraCIServer::writeStatusCmd().

Referenced by TraCIServer::TraCIServer().


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