SUMO - Simulation of Urban MObility
|
APIs for getting/setting vehicle values via TraCI. More...
#include <TraCIServerAPI_Vehicle.h>
Static Public Member Functions | |
static bool | getPosition (const std::string &id, Position &p) |
Returns the named vehicle's position. | |
static bool | processGet (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage) |
Processes a get value command (Command 0xa4: Get Vehicle Variable) | |
static bool | processSet (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage) |
Processes a set value command (Command 0xc4: Change Vehicle State) |
Private Member Functions | |
TraCIServerAPI_Vehicle & | operator= (const TraCIServerAPI_Vehicle &s) |
invalidated assignment operator | |
TraCIServerAPI_Vehicle (const TraCIServerAPI_Vehicle &s) | |
invalidated copy constructor |
Static Private Member Functions | |
static bool | commandDistanceRequest (traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, const MSVehicle *v) |
static const std::map < std::string, std::vector < MSLane * > > & | getOrBuildVTDMap () |
static MSVehicleType & | getSingularType (SUMOVehicle *const veh) |
static bool | vtdMap_matchingEdgeLane (const Position &pos, const std::string &origID, MSVehicle &v, bool report, SUMOReal &bestDistance, MSLane **lane, SUMOReal &lanePos, int &routeOffset, MSEdgeVector &edges) |
static bool | vtdMap_matchingNearest (const Position &pos, const std::string &origID, MSVehicle &v, traci::TraCIServer &server, bool report, SUMOReal &bestDistance, MSLane **lane, SUMOReal &lanePos, int &routeOffset, MSEdgeVector &edges) |
static bool | vtdMap_matchingRoutePosition (const Position &pos, const std::string &origID, MSVehicle &v, bool report, SUMOReal &bestDistance, MSLane **lane, SUMOReal &lanePos, int &routeOffset, MSEdgeVector &edges) |
Static Private Attributes | |
static std::map< std::string, std::vector< MSLane * > > | gVTDMap |
APIs for getting/setting vehicle values via TraCI.
Definition at line 49 of file TraCIServerAPI_Vehicle.h.
|
private |
invalidated copy constructor
|
staticprivate |
Definition at line 1198 of file TraCIServerAPI_Vehicle.cpp.
References CMD_GET_VEHICLE_VARIABLE, TraCIServerAPI_Simulation::convertCartesianToRoadMap(), Position::distanceTo(), MSRoute::getDistanceBetween(), MSBaseVehicle::getEdge(), TraCIServerAPI_Simulation::getLaneChecking(), MSVehicle::getPosition(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), INVALID_DOUBLE_VALUE, MSVehicle::isOnRoad(), max, POSITION_2D, POSITION_3D, POSITION_ROADMAP, tcpip::Storage::readDouble(), tcpip::Storage::readInt(), tcpip::Storage::readString(), tcpip::Storage::readUnsignedByte(), REQUEST_DRIVINGDIST, Position::set(), SUMOReal, TYPE_COMPOUND, TYPE_DOUBLE, tcpip::Storage::writeDouble(), traci::TraCIServer::writeErrorStatusCmd(), and tcpip::Storage::writeUnsignedByte().
|
staticprivate |
Definition at line 1286 of file TraCIServerAPI_Vehicle.cpp.
References MSNet::getEdgeControl(), MSEdgeControl::getEdges(), and MSNet::getInstance().
Returns the named vehicle's position.
[in] | id | The id of the searched vehicle |
[out] | p | The position, if the vehicle is on the network |
Definition at line 1263 of file TraCIServerAPI_Vehicle.cpp.
References MSNet::getInstance(), MSVehicle::getPosition(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().
Referenced by traci::TraCIServer::findObjectShape().
|
staticprivate |
Definition at line 1274 of file TraCIServerAPI_Vehicle.cpp.
References MSVehicleType::build(), SUMOVehicle::getID(), MSVehicleType::getID(), and SUMOVehicle::getVehicleType().
|
private |
invalidated assignment operator
|
static |
Processes a get value command (Command 0xa4: Get Vehicle 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 73 of file TraCIServerAPI_Vehicle.cpp.
References MSVehicle::LaneQ::allowsContinuation, RGBColor::alpha(), MSRoute::begin(), MSVehicle::LaneQ::bestContinuations, MSVehicle::LaneQ::bestLaneOffset, RGBColor::blue(), CMD_GET_VEHICLE_VARIABLE, CMD_SET_VEHICLE_VARIABLE, SUMOVehicleParameter::color, HelpersHBEFA::computeCO(), HelpersHBEFA::computeCO2(), HelpersHBEFA::computeFuel(), HelpersHBEFA::computeHC(), HelpersHarmonoise::computeNoise(), HelpersHBEFA::computeNOx(), HelpersHBEFA::computePMx(), MSEdge::dictionary(), DISTANCE_REQUEST, MSRoute::end(), MSVehicle::getAcceleration(), MSVehicle::getAngle(), MSVehicle::getBestLanes(), MSLane::getEdge(), MSVehicleType::getEmissionClass(), Named::getID(), MSVehicleType::getID(), MSNet::getInstance(), MSVehicle::getLane(), MSEdge::getLanes(), MSBaseVehicle::getParameter(), MSVehicle::getPersonNumber(), MSVehicle::getPosition(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), MSVehicle::getSignals(), MSVehicle::getSpeed(), MSVehicle::getSpeedWithoutTraciInfluence(), TraCIServerAPI_VehicleType::getVariable(), MSVehicleControl::getVehicle(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), MSVehicle::getWeightsStorage(), RGBColor::green(), MSBaseVehicle::hasValidRoute(), ID_COUNT, ID_LIST, INVALID_DOUBLE_VALUE, INVALID_INT_VALUE, MSVehicle::isOnRoad(), MSVehicle::LaneQ::lane, MSVehicle::LaneQ::length, MSVehicleControl::loadedVehBegin(), MSVehicleControl::loadedVehEnd(), MSVehicle::LaneQ::nextOccupation, POSITION_2D, tcpip::Storage::readInt(), tcpip::Storage::readString(), traci::TraCIServer::readTypeCheckingInt(), traci::TraCIServer::readTypeCheckingString(), tcpip::Storage::readUnsignedByte(), RGBColor::red(), RESPONSE_GET_VEHICLE_VARIABLE, MSEdgeWeightsStorage::retrieveExistingEffort(), MSEdgeWeightsStorage::retrieveExistingTravelTime(), RTYPE_OK, MSRoute::size(), SUMOReal, TYPE_BYTE, TYPE_COLOR, TYPE_COMPOUND, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, TYPE_STRINGLIST, TYPE_UBYTE, VAR_ACCEL, VAR_ANGLE, VAR_BEST_LANES, VAR_CO2EMISSION, VAR_COEMISSION, VAR_COLOR, VAR_DECEL, VAR_EDGE_EFFORT, VAR_EDGE_TRAVELTIME, VAR_EDGES, VAR_EMISSIONCLASS, VAR_FUELCONSUMPTION, VAR_HCEMISSION, VAR_IMPERFECTION, VAR_LANE_ID, VAR_LANE_INDEX, VAR_LANEPOSITION, VAR_LENGTH, VAR_MAXSPEED, VAR_MINGAP, VAR_NOISEEMISSION, VAR_NOXEMISSION, VAR_PERSON_NUMBER, VAR_PMXEMISSION, VAR_POSITION, VAR_ROAD_ID, VAR_ROUTE_ID, VAR_ROUTE_VALID, VAR_SHAPECLASS, VAR_SIGNALS, VAR_SPEED, VAR_SPEED_DEVIATION, VAR_SPEED_FACTOR, VAR_SPEED_WITHOUT_TRACI, VAR_TAU, VAR_TYPE, VAR_VEHICLECLASS, VAR_WIDTH, tcpip::Storage::writeByte(), tcpip::Storage::writeDouble(), traci::TraCIServer::writeErrorStatusCmd(), tcpip::Storage::writeInt(), traci::TraCIServer::writeResponseWithLength(), traci::TraCIServer::writeStatusCmd(), tcpip::Storage::writeStorage(), tcpip::Storage::writeString(), tcpip::Storage::writeStringList(), tcpip::Storage::writeUnsignedByte(), Position::x(), and Position::y().
Referenced by traci::TraCIServer::TraCIServer().
|
static |
Processes a set value command (Command 0xc4: Change Vehicle State)
[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 353 of file TraCIServerAPI_Vehicle.cpp.
References MSInsertionControl::add(), ADD, MSEdgeWeightsStorage::addEffort(), MSVehicle::addTraciStop(), MSEdgeWeightsStorage::addTravelTime(), MSVehicleControl::addVehicle(), RGBColor::alpha(), RGBColor::blue(), MSVehicleControl::buildVehicle(), MSVehicle::Influencer::checkForLaneChanges(), CMD_CHANGELANE, CMD_CHANGETARGET, CMD_GET_VEHICLE_VARIABLE, CMD_REROUTE_EFFORT, CMD_REROUTE_TRAVELTIME, CMD_SET_POLYGON_VARIABLE, CMD_SET_VEHICLE_VARIABLE, CMD_SLOWDOWN, CMD_STOP, SUMOVehicleParameter::color, SUMOAbstractRouter< E, V >::compute(), SUMOVehicleParameter::depart, DEPART_DEF_MAX, DEPART_LANE_DEF_MAX, DEPART_LANE_GIVEN, DEPART_POS_DEF_MAX, DEPART_POS_GIVEN, DEPART_SPEED_DEF_MAX, DEPART_SPEED_GIVEN, SUMOVehicleParameter::departLane, SUMOVehicleParameter::departLaneProcedure, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departPosProcedure, SUMOVehicleParameter::departProcedure, SUMOVehicleParameter::departSpeed, SUMOVehicleParameter::departSpeedProcedure, MSRoute::dictionary(), MSLane::dictionary(), MSEdge::dictionary(), MSVehicle::enterLaneAtMove(), MSLane::forceVehicleInsertion(), MSVehicle::getBestLanes(), MSBaseVehicle::getEdge(), MSLane::getEdge(), Named::getID(), MSBaseVehicle::getID(), MSVehicle::getInfluencer(), MSNet::getInsertionControl(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::getLaneIndex(), MSEdge::getLanes(), MSBaseVehicle::getParameter(), MSVehicle::getPosition(), MSNet::getRouterTT(), MSVehicle::getSpeed(), MSVehicleControl::getVehicle(), MSNet::getVehicleControl(), MSVehicleControl::getVType(), MSVehicle::getWeightsStorage(), RGBColor::green(), MSBaseVehicle::hasDeparted(), SUMOVehicleParameter::id, MSVehicle::isOnRoad(), MSEdgeWeightsStorage::knowsEffort(), MSEdgeWeightsStorage::knowsTravelTime(), MSMoveReminder::NOTIFICATION_ARRIVED, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSMoveReminder::NOTIFICATION_VAPORIZED, MSVehicle::onRemovalFromNet(), MSEdge::parseEdgesList(), tcpip::Storage::readInt(), tcpip::Storage::readString(), traci::TraCIServer::readTypeCheckingByte(), traci::TraCIServer::readTypeCheckingColor(), traci::TraCIServer::readTypeCheckingDouble(), traci::TraCIServer::readTypeCheckingInt(), traci::TraCIServer::readTypeCheckingString(), traci::TraCIServer::readTypeCheckingStringList(), tcpip::Storage::readUnsignedByte(), RGBColor::red(), REMOVE, REMOVE_ARRIVED, REMOVE_PARKING, REMOVE_TELEPORT, REMOVE_TELEPORT_ARRIVED, REMOVE_VAPORIZED, MSEdgeWeightsStorage::removeEffort(), MSEdgeWeightsStorage::removeTravelTime(), MSLane::removeVehicle(), MSVehicle::replaceRoute(), MSBaseVehicle::replaceRouteEdges(), MSAbstractLaneChangeModel::requestLaneChange(), MSBaseVehicle::reroute(), RTYPE_OK, MSVehicleControl::scheduleVehicleRemoval(), RGBColor::set(), MSVehicle::Influencer::setConsiderMaxAcceleration(), MSVehicle::Influencer::setConsiderMaxDeceleration(), MSVehicle::Influencer::setConsiderSafeVelocity(), MSVehicle::Influencer::setLaneTimeLine(), SUMOVehicleParameter::setParameter, MSVehicle::Influencer::setSpeedTimeLine(), TraCIServerAPI_VehicleType::setVariable(), traci::TraCIServer::setVTDControlled(), MSBaseVehicle::succEdge(), SUMOReal, SUMOTime_MAX, MSVehicle::switchOffSignal(), MSVehicle::switchOnSignal(), toString(), TYPE_COMPOUND, VAR_ACCEL, VAR_COLOR, VAR_DECEL, VAR_EDGE_EFFORT, VAR_EDGE_TRAVELTIME, VAR_EMISSIONCLASS, VAR_IMPERFECTION, VAR_LENGTH, VAR_MAXSPEED, VAR_MINGAP, VAR_MOVE_TO, VAR_MOVE_TO_VTD, VAR_ROUTE, VAR_ROUTE_ID, VAR_SHAPECLASS, VAR_SIGNALS, VAR_SPEED, VAR_SPEED_DEVIATION, VAR_SPEED_FACTOR, VAR_SPEEDSETMODE, VAR_TAU, VAR_VEHICLECLASS, VAR_WIDTH, VEHPARS_COLOR_SET, traci::TraCIServer::vtdDebug(), MSVehicle::willPass(), traci::TraCIServer::writeErrorStatusCmd(), and traci::TraCIServer::writeStatusCmd().
Referenced by traci::TraCIServer::TraCIServer().
|
staticprivate |
Definition at line 1003 of file TraCIServerAPI_Vehicle.cpp.
References PositionVector::distance(), MSEdge::EDGEFUNCTION_INTERNAL, MSLane::getEdge(), MSRoute::getEdges(), Named::getID(), MSLane::getIncomingLanes(), MSEdge::getPurpose(), MSBaseVehicle::getRoute(), MSVehicle::getRoutePosition(), MSLane::getShape(), MAX2(), MIN2(), POSITION_EPS, and SUMOReal.
|
staticprivate |
Definition at line 1100 of file TraCIServerAPI_Vehicle.cpp.
References CMD_GET_EDGE_VARIABLE, traci::TraCIServer::collectObjectsInRange(), MSEdge::dictionary(), PositionVector::distance(), MSEdge::EDGEFUNCTION_INTERNAL, MSLane::getEdge(), MSRoute::getEdges(), MSVehicle::getLane(), MSEdge::getLanes(), MSLane::getLinkCont(), MSLane::getLogicalPredecessorLane(), Parameterised::getParameter(), MSEdge::getPurpose(), MSBaseVehicle::getRoute(), MSVehicle::getRoutePosition(), MSLane::getShape(), MSLane::interpolateGeometryPosToLanePos(), Parameterised::knowsParameter(), PositionVector::push_back(), and SUMOReal.
|
staticprivate |
Definition at line 1053 of file TraCIServerAPI_Vehicle.cpp.
References PositionVector::distance(), MSEdge::EDGEFUNCTION_INTERNAL, MSVehicle::getBestLanesContinuation(), Named::getID(), MSVehicle::getLane(), MSEdge::getLanes(), MSLane::getLength(), MSEdge::getPurpose(), MSLane::getShape(), MAX2(), MIN2(), PositionVector::nearest_offset_to_point2D(), POSITION_EPS, and SUMOReal.
|
staticprivate |
Definition at line 94 of file TraCIServerAPI_Vehicle.h.