SUMO - Simulation of Urban MObility
TraCIServerAPI_Vehicle Class Reference

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

#include <TraCIServerAPI_Vehicle.h>

Collaboration diagram for TraCIServerAPI_Vehicle:
Collaboration graph

Static Public Member Functions

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

Private Member Functions

TraCIServerAPI_Vehicleoperator= (const TraCIServerAPI_Vehicle &s)
 invalidated assignment operator More...
 
 TraCIServerAPI_Vehicle (const TraCIServerAPI_Vehicle &s)
 invalidated copy constructor More...
 

Detailed Description

APIs for getting/setting vehicle values via TraCI.

Definition at line 47 of file TraCIServerAPI_Vehicle.h.

Constructor & Destructor Documentation

◆ TraCIServerAPI_Vehicle()

TraCIServerAPI_Vehicle::TraCIServerAPI_Vehicle ( const TraCIServerAPI_Vehicle s)
private

invalidated copy constructor

Member Function Documentation

◆ getPosition()

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

Returns the named vehicle's position.

Parameters
[in]idThe id of the searched vehicle
[out]pThe position, if the vehicle is on the network
Returns
Whether the vehicle is known (and on road)

Definition at line 1199 of file TraCIServerAPI_Vehicle.cpp.

References MSNet::getInstance(), MSVehicle::getPosition(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().

Referenced by TraCIServer::findObjectShape().

◆ operator=()

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

invalidated assignment operator

◆ processGet()

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

Processes a get value command (Command 0xa4: Get Vehicle 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 69 of file TraCIServerAPI_Vehicle.cpp.

References libsumo::TraCIColor::a, libsumo::TraCIBestLanesData::allowsContinuation, libsumo::TraCIColor::b, libsumo::TraCIBestLanesData::bestLaneOffset, CMD_CHANGELANE, CMD_GET_VEHICLE_VARIABLE, libsumo::TraCIBestLanesData::continuationLanes, DISTANCE_REQUEST, libsumo::TraCIColor::g, libsumo::Vehicle::getAccumulatedWaitingTime(), libsumo::Vehicle::getAdaptedTraveltime(), libsumo::Vehicle::getAllowedSpeed(), libsumo::Vehicle::getAngle(), libsumo::Vehicle::getBestLanes(), libsumo::Vehicle::getCO2Emission(), libsumo::Vehicle::getCOEmission(), libsumo::Vehicle::getColor(), libsumo::Vehicle::getDistance(), libsumo::Vehicle::getDrivingDistance(), libsumo::Vehicle::getDrivingDistance2D(), libsumo::Vehicle::getEdges(), libsumo::Vehicle::getEffort(), libsumo::Vehicle::getElectricityConsumption(), libsumo::Vehicle::getFuelConsumption(), libsumo::Vehicle::getHCEmission(), libsumo::Vehicle::getIDCount(), libsumo::Vehicle::getIDList(), libsumo::Vehicle::getLanechangeMode(), libsumo::Vehicle::getLaneChangeState(), libsumo::Vehicle::getLaneID(), libsumo::Vehicle::getLaneIndex(), libsumo::Vehicle::getLanePosition(), libsumo::Vehicle::getLastActionTime(), libsumo::Vehicle::getLateralLanePosition(), libsumo::Vehicle::getLeader(), libsumo::Vehicle::getLine(), libsumo::Vehicle::getNextTLS(), libsumo::Vehicle::getNoiseEmission(), libsumo::Vehicle::getNOxEmission(), libsumo::Vehicle::getParameter(), libsumo::Vehicle::getPersonNumber(), libsumo::Vehicle::getPMxEmission(), libsumo::Vehicle::getPosition(), libsumo::Vehicle::getRoadID(), libsumo::Vehicle::getRouteID(), libsumo::Vehicle::getRouteIndex(), libsumo::Vehicle::getRoutingMode(), libsumo::Vehicle::getSignalStates(), libsumo::Vehicle::getSlope(), libsumo::Vehicle::getSpeed(), libsumo::Vehicle::getSpeedFactor(), libsumo::Vehicle::getSpeedMode(), libsumo::Vehicle::getSpeedWithoutTraCI(), libsumo::Vehicle::getStopState(), libsumo::Vehicle::getTypeID(), TraCIServerAPI_VehicleType::getVariable(), libsumo::Vehicle::getVehicleType(), libsumo::Vehicle::getVia(), libsumo::Vehicle::getWaitingTime(), ID_COUNT, ID_LIST, libsumo::Vehicle::isRouteValid(), libsumo::TraCIBestLanesData::laneID, libsumo::TraCIBestLanesData::length, libsumo::TraCIBestLanesData::occupation, POSITION_2D, POSITION_3D, POSITION_ROADMAP, libsumo::TraCIColor::r, tcpip::Storage::readDouble(), tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), REQUEST_DRIVINGDIST, RESPONSE_GET_VEHICLE_VARIABLE, RTYPE_OK, toHex(), TYPE_BYTE, TYPE_COLOR, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, TYPE_STRINGLIST, TYPE_UBYTE, VAR_ACCEL, VAR_ACCUMULATED_WAITING_TIME, VAR_ACTIONSTEPLENGTH, VAR_ALLOWED_SPEED, VAR_ANGLE, VAR_APPARENT_DECEL, VAR_BEST_LANES, VAR_CO2EMISSION, VAR_COEMISSION, VAR_COLOR, VAR_DECEL, VAR_DISTANCE, VAR_EDGE_EFFORT, VAR_EDGE_TRAVELTIME, VAR_EDGES, VAR_ELECTRICITYCONSUMPTION, VAR_EMERGENCY_DECEL, VAR_EMISSIONCLASS, VAR_FUELCONSUMPTION, VAR_HCEMISSION, VAR_HEIGHT, VAR_IMPERFECTION, VAR_LANE_ID, VAR_LANE_INDEX, VAR_LANECHANGE_MODE, VAR_LANEPOSITION, VAR_LANEPOSITION_LAT, VAR_LASTACTIONTIME, VAR_LATALIGNMENT, VAR_LEADER, VAR_LENGTH, VAR_LINE, VAR_MAXSPEED, VAR_MAXSPEED_LAT, VAR_MINGAP, VAR_MINGAP_LAT, VAR_NEXT_TLS, VAR_NOISEEMISSION, VAR_NOXEMISSION, VAR_PARAMETER, VAR_PERSON_NUMBER, VAR_PMXEMISSION, VAR_POSITION, VAR_POSITION3D, VAR_ROAD_ID, VAR_ROUTE_ID, VAR_ROUTE_INDEX, VAR_ROUTE_VALID, VAR_ROUTING_MODE, VAR_SHAPECLASS, VAR_SIGNALS, VAR_SLOPE, VAR_SPEED, VAR_SPEED_DEVIATION, VAR_SPEED_FACTOR, VAR_SPEED_WITHOUT_TRACI, VAR_SPEEDSETMODE, VAR_STOPSTATE, VAR_TAU, VAR_TYPE, VAR_VEHICLECLASS, VAR_VIA, VAR_WAITING_TIME, VAR_WIDTH, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), TraCIServer::writeErrorStatusCmd(), tcpip::Storage::writeInt(), TraCIServer::writeResponseWithLength(), TraCIServer::writeStatusCmd(), tcpip::Storage::writeStorage(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), tcpip::Storage::writeUnsignedByte(), libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.

Referenced by TraCIServer::TraCIServer().

◆ processSet()

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

Processes a set value command (Command 0xc4: Change Vehicle 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

XXX but a big try/catch around all retrieval cases

Definition at line 495 of file TraCIServerAPI_Vehicle.cpp.

References libsumo::TraCIColor::a, MSInsertionControl::add(), libsumo::Vehicle::add(), ADD, ADD_FULL, MSVehicleControl::addVehicle(), MSInsertionControl::alreadyDeparted(), SUMOVehicleParameter::arrivalLane, SUMOVehicleParameter::arrivalLaneProcedure, SUMOVehicleParameter::arrivalPos, SUMOVehicleParameter::arrivalPosProcedure, SUMOVehicleParameter::arrivalSpeed, SUMOVehicleParameter::arrivalSpeedProcedure, libsumo::TraCIColor::b, MSVehicleControl::buildVehicle(), libsumo::Vehicle::changeLane(), libsumo::Vehicle::changeSublane(), libsumo::Vehicle::changeTarget(), CMD_CHANGELANE, CMD_CHANGESUBLANE, CMD_CHANGETARGET, CMD_GET_VEHICLE_VARIABLE, CMD_REROUTE_EFFORT, CMD_REROUTE_TRAVELTIME, CMD_RESUME, CMD_SET_VEHICLE_VARIABLE, CMD_SLOWDOWN, CMD_STOP, SUMOVehicleParameter::color, MSVehicleControl::deleteVehicle(), DELTA_T, SUMOVehicleParameter::depart, DEPART_GIVEN, SUMOVehicleParameter::departLane, SUMOVehicleParameter::departLaneProcedure, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departPosProcedure, SUMOVehicleParameter::departProcedure, SUMOVehicleParameter::departSpeed, SUMOVehicleParameter::departSpeedProcedure, MSRoute::dictionary(), SUMOVehicleParameter::fromTaz, libsumo::TraCIColor::g, MSNet::getCurrentTimeStep(), MSBaseVehicle::getEdge(), Named::getID(), MSVehicleType::getID(), MSVehicle::getInfluencer(), MSNet::getInsertionControl(), MSNet::getInstance(), MSVehicle::getLane(), MSEdge::getLanes(), MSBaseVehicle::getParameter(), MSBaseVehicle::getSingularType(), MSVehicleControl::getVehicle(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), MSBaseVehicle::hasDeparted(), SUMOVehicleParameter::id, INVALID_DOUBLE_VALUE, SUMOVehicleParameter::line, MOVE_TO_XY, libsumo::Vehicle::moveTo(), libsumo::Vehicle::moveToXY(), MSMoveReminder::NOTIFICATION_ARRIVED, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSMoveReminder::NOTIFICATION_VAPORIZED, MSVehicle::onRemovalFromNet(), SUMOVehicleParameter::parametersSet, SUMOVehicleParameter::parseArrivalLane(), SUMOVehicleParameter::parseArrivalPos(), SUMOVehicleParameter::parseArrivalSpeed(), SUMOVehicleParameter::parseDepart(), SUMOVehicleParameter::parseDepartLane(), SUMOVehicleParameter::parseDepartPos(), SUMOVehicleParameter::parseDepartSpeed(), MSEdge::parseEdgesList(), SUMOVehicleParameter::personNumber, POSITION_EPS, libsumo::TraCIColor::r, tcpip::Storage::readInt(), tcpip::Storage::readString(), TraCIServer::readTypeCheckingByte(), TraCIServer::readTypeCheckingColor(), TraCIServer::readTypeCheckingDouble(), TraCIServer::readTypeCheckingInt(), TraCIServer::readTypeCheckingString(), TraCIServer::readTypeCheckingStringList(), tcpip::Storage::readUnsignedByte(), REMOVE, REMOVE_ARRIVED, REMOVE_PARKING, REMOVE_TELEPORT, REMOVE_TELEPORT_ARRIVED, REMOVE_VAPORIZED, MSLane::removeVehicle(), libsumo::Vehicle::rerouteEffort(), libsumo::Vehicle::rerouteTraveltime(), libsumo::Vehicle::resume(), RTYPE_ERR, RTYPE_OK, MSVehicleControl::scheduleVehicleRemoval(), RGBColor::set(), libsumo::Vehicle::setActionStepLength(), libsumo::Vehicle::setAdaptedTraveltime(), MSBaseVehicle::setChosenSpeedFactor(), libsumo::Vehicle::setEffort(), MSVehicle::Influencer::setLaneChangeMode(), libsumo::Vehicle::setParameter(), libsumo::Vehicle::setRoute(), libsumo::Vehicle::setRouteID(), MSVehicle::Influencer::setRoutingMode(), libsumo::Vehicle::setSignals(), MSVehicle::Influencer::setSpeedMode(), MSVehicle::Influencer::setSpeedTimeLine(), libsumo::Vehicle::setStop(), libsumo::Vehicle::setType(), TraCIServerAPI_VehicleType::setVariable(), SIMTIME, libsumo::Vehicle::slowDown(), SUMOTime_MAX, toHex(), toString(), SUMOVehicleParameter::toTaz, TYPE_COMPOUND, VAR_ACCEL, VAR_ACTIONSTEPLENGTH, VAR_APPARENT_DECEL, VAR_COLOR, VAR_DECEL, VAR_EDGE_EFFORT, VAR_EDGE_TRAVELTIME, VAR_EMERGENCY_DECEL, VAR_EMISSIONCLASS, VAR_HEIGHT, VAR_IMPERFECTION, VAR_LANECHANGE_MODE, VAR_LATALIGNMENT, VAR_LENGTH, VAR_LINE, VAR_MAXSPEED, VAR_MAXSPEED_LAT, VAR_MINGAP, VAR_MINGAP_LAT, VAR_MOVE_TO, VAR_PARAMETER, VAR_ROUTE, VAR_ROUTE_ID, VAR_ROUTING_MODE, VAR_SHAPECLASS, VAR_SIGNALS, VAR_SPEED, VAR_SPEED_FACTOR, VAR_SPEEDSETMODE, VAR_TAU, VAR_TYPE, VAR_VEHICLECLASS, VAR_VIA, VAR_WIDTH, VEHPARS_COLOR_SET, SUMOVehicleParameter::via, TraCIServer::writeErrorStatusCmd(), and TraCIServer::writeStatusCmd().

Referenced by TraCIServer::TraCIServer().


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