LCOV - code coverage report
Current view: top level - src/libtraci - Person.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 71.6 % 313 224
Test Date: 2024-10-24 15:46:30 Functions: 59.8 % 92 55

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2017-2024 German Aerospace Center (DLR) and others.
       4              : // This program and the accompanying materials are made available under the
       5              : // terms of the Eclipse Public License 2.0 which is available at
       6              : // https://www.eclipse.org/legal/epl-2.0/
       7              : // This Source Code may also be made available under the following Secondary
       8              : // Licenses when the conditions for such availability set forth in the Eclipse
       9              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      10              : // or later which is available at
      11              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      12              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      13              : /****************************************************************************/
      14              : /// @file    Person.cpp
      15              : /// @author  Leonhard Luecken
      16              : /// @date    15.09.2017
      17              : ///
      18              : // C++ TraCI client API implementation
      19              : /****************************************************************************/
      20              : #include <config.h>
      21              : 
      22              : #define LIBTRACI 1
      23              : #include "Domain.h"
      24              : #include <libsumo/Person.h>
      25              : #include <libsumo/StorageHelper.h>
      26              : 
      27              : namespace libtraci {
      28              : 
      29              : typedef Domain<libsumo::CMD_GET_PERSON_VARIABLE, libsumo::CMD_SET_PERSON_VARIABLE> Dom;
      30              : 
      31              : // ===========================================================================
      32              : // static member definitions
      33              : // ===========================================================================
      34              : std::vector<std::string>
      35        14247 : Person::getIDList() {
      36        28493 :     return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");
      37              : }
      38              : 
      39              : 
      40              : int
      41            4 : Person::getIDCount() {
      42            8 :     return Dom::getInt(libsumo::ID_COUNT, "");
      43              : }
      44              : 
      45              : 
      46              : libsumo::TraCIPosition
      47        24762 : Person::getPosition(const std::string& personID, const bool includeZ) {
      48        24762 :     return includeZ ? getPosition3D(personID) : Dom::getPos(libsumo::VAR_POSITION, personID);
      49              : }
      50              : 
      51              : 
      52              : libsumo::TraCIPosition
      53            2 : Person::getPosition3D(const std::string& personID) {
      54            2 :     return Dom::getPos3D(libsumo::VAR_POSITION3D, personID);
      55              : }
      56              : 
      57              : 
      58              : double
      59           22 : Person::getAngle(const std::string& personID) {
      60           22 :     return Dom::getDouble(libsumo::VAR_ANGLE, personID);
      61              : }
      62              : 
      63              : 
      64              : double
      65            2 : Person::getSlope(const std::string& personID) {
      66            2 :     return Dom::getDouble(libsumo::VAR_SLOPE, personID);
      67              : }
      68              : 
      69              : 
      70              : double
      71            6 : Person::getSpeed(const std::string& personID) {
      72            6 :     return Dom::getDouble(libsumo::VAR_SPEED, personID);
      73              : }
      74              : 
      75              : 
      76              : std::string
      77          247 : Person::getRoadID(const std::string& personID) {
      78          247 :     return Dom::getString(libsumo::VAR_ROAD_ID, personID);
      79              : }
      80              : 
      81              : 
      82              : std::string
      83           61 : Person::getLaneID(const std::string& personID) {
      84           61 :     return Dom::getString(libsumo::VAR_LANE_ID, personID);
      85              : }
      86              : 
      87              : 
      88              : double
      89           23 : Person::getLanePosition(const std::string& personID) {
      90           23 :     return Dom::getDouble(libsumo::VAR_LANEPOSITION, personID);
      91              : }
      92              : 
      93              : 
      94              : std::vector<libsumo::TraCIReservation>
      95          441 : Person::getTaxiReservations(int onlyNew) {
      96          441 :     std::unique_lock<std::mutex> lock{ libtraci::Connection::getActive().getMutex() };
      97          441 :     tcpip::Storage content;
      98              :     StoHelp::writeTypedInt(content, onlyNew);
      99          882 :     tcpip::Storage& ret = Dom::get(libsumo::VAR_TAXI_RESERVATIONS, "", &content);
     100              :     std::vector<libsumo::TraCIReservation> result;
     101          441 :     int numReservations = ret.readInt();
     102         1153 :     while (numReservations-- > 0) {
     103              :         libsumo::TraCIReservation r;
     104          712 :         StoHelp::readCompound(ret, 10);
     105          712 :         r.id = StoHelp::readTypedString(ret);
     106          712 :         r.persons = StoHelp::readTypedStringList(ret);
     107          712 :         r.group = StoHelp::readTypedString(ret);
     108          712 :         r.fromEdge = StoHelp::readTypedString(ret);
     109          712 :         r.toEdge = StoHelp::readTypedString(ret);
     110          712 :         r.departPos = StoHelp::readTypedDouble(ret);
     111          712 :         r.arrivalPos = StoHelp::readTypedDouble(ret);
     112          712 :         r.depart = StoHelp::readTypedDouble(ret);
     113          712 :         r.reservationTime = StoHelp::readTypedDouble(ret);
     114          712 :         r.state = StoHelp::readTypedInt(ret);
     115          712 :         result.emplace_back(r);
     116          712 :     }
     117          441 :     return result;
     118          441 : }
     119              : 
     120              : 
     121              : std::string
     122            1 : Person::splitTaxiReservation(std::string reservationID, const std::vector<std::string>& personIDs) {
     123            1 :     tcpip::Storage content;
     124              :     StoHelp::writeTypedStringList(content, personIDs);
     125            2 :     return Dom::getString(libsumo::SPLIT_TAXI_RESERVATIONS, reservationID, &content);
     126            1 : }
     127              : 
     128              : 
     129              : libsumo::TraCIColor
     130            2 : Person::getColor(const std::string& personID) {
     131            2 :     return Dom::getCol(libsumo::VAR_COLOR, personID);
     132              : }
     133              : 
     134              : 
     135              : std::string
     136            5 : Person::getTypeID(const std::string& personID) {
     137            5 :     return Dom::getString(libsumo::VAR_TYPE, personID);
     138              : }
     139              : 
     140              : 
     141              : double
     142            2 : Person::getWaitingTime(const std::string& personID) {
     143            2 :     return Dom::getDouble(libsumo::VAR_WAITING_TIME, personID);
     144              : }
     145              : 
     146              : 
     147              : std::string
     148            1 : Person::getNextEdge(const std::string& personID) {
     149            1 :     return Dom::getString(libsumo::VAR_NEXT_EDGE, personID);
     150              : }
     151              : 
     152              : 
     153              : std::vector<std::string>
     154          228 : Person::getEdges(const std::string& personID, int nextStageIndex) {
     155          228 :     tcpip::Storage content;
     156          228 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     157          228 :     content.writeInt(nextStageIndex);
     158          456 :     return Dom::getStringVector(libsumo::VAR_EDGES, personID, &content);
     159          228 : }
     160              : 
     161              : 
     162              : libsumo::TraCIStage
     163          188 : Person::getStage(const std::string& personID, int nextStageIndex) {
     164          188 :     tcpip::Storage content;
     165          188 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     166          188 :     content.writeInt(nextStageIndex);
     167          361 :     return Dom::getTraCIStage(libsumo::VAR_STAGE, personID, &content);
     168          188 : }
     169              : 
     170              : 
     171              : int
     172           19 : Person::getRemainingStages(const std::string& personID) {
     173           19 :     return Dom::getInt(libsumo::VAR_STAGES_REMAINING, personID);
     174              : }
     175              : 
     176              : 
     177              : std::string
     178            2 : Person::getVehicle(const std::string& personID) {
     179            2 :     return Dom::getString(libsumo::VAR_VEHICLE, personID);
     180              : }
     181              : 
     182              : 
     183              : std::string
     184            0 : Person::getEmissionClass(const std::string& personID) {
     185            0 :     return Dom::getString(libsumo::VAR_EMISSIONCLASS, personID);
     186              : }
     187              : 
     188              : 
     189              : std::string
     190            0 : Person::getShapeClass(const std::string& personID) {
     191            0 :     return Dom::getString(libsumo::VAR_SHAPECLASS, personID);
     192              : }
     193              : 
     194              : 
     195              : double
     196            2 : Person::getLength(const std::string& personID) {
     197            2 :     return Dom::getDouble(libsumo::VAR_LENGTH, personID);
     198              : }
     199              : 
     200              : 
     201              : double
     202            2 : Person::getSpeedFactor(const std::string& personID) {
     203            2 :     return Dom::getDouble(libsumo::VAR_SPEED_FACTOR, personID);
     204              : }
     205              : 
     206              : 
     207              : double
     208            0 : Person::getAccel(const std::string& personID) {
     209            0 :     return Dom::getDouble(libsumo::VAR_ACCEL, personID);
     210              : }
     211              : 
     212              : 
     213              : double
     214            0 : Person::getDecel(const std::string& personID) {
     215            0 :     return Dom::getDouble(libsumo::VAR_DECEL, personID);
     216              : }
     217              : 
     218              : 
     219            0 : double Person::getEmergencyDecel(const std::string& personID) {
     220            0 :     return Dom::getDouble(libsumo::VAR_EMERGENCY_DECEL, personID);
     221              : }
     222              : 
     223              : 
     224            0 : double Person::getApparentDecel(const std::string& personID) {
     225            0 :     return Dom::getDouble(libsumo::VAR_APPARENT_DECEL, personID);
     226              : }
     227              : 
     228              : 
     229            0 : double Person::getActionStepLength(const std::string& personID) {
     230            0 :     return Dom::getDouble(libsumo::VAR_ACTIONSTEPLENGTH, personID);
     231              : }
     232              : 
     233              : 
     234              : double
     235            0 : Person::getTau(const std::string& personID) {
     236            0 :     return Dom::getDouble(libsumo::VAR_TAU, personID);
     237              : }
     238              : 
     239              : 
     240              : double
     241            0 : Person::getImperfection(const std::string& personID) {
     242            0 :     return Dom::getDouble(libsumo::VAR_IMPERFECTION, personID);
     243              : }
     244              : 
     245              : 
     246              : double
     247            0 : Person::getSpeedDeviation(const std::string& personID) {
     248            0 :     return Dom::getDouble(libsumo::VAR_SPEED_DEVIATION, personID);
     249              : }
     250              : 
     251              : 
     252              : std::string
     253            0 : Person::getVehicleClass(const std::string& personID) {
     254            0 :     return Dom::getString(libsumo::VAR_VEHICLECLASS, personID);
     255              : }
     256              : 
     257              : 
     258              : double
     259            2 : Person::getMinGap(const std::string& personID) {
     260            2 :     return Dom::getDouble(libsumo::VAR_MINGAP, personID);
     261              : }
     262              : 
     263              : 
     264              : double
     265            0 : Person::getMinGapLat(const std::string& personID) {
     266            0 :     return Dom::getDouble(libsumo::VAR_MINGAP_LAT, personID);
     267              : }
     268              : 
     269              : 
     270              : double
     271            2 : Person::getMaxSpeed(const std::string& personID) {
     272            2 :     return Dom::getDouble(libsumo::VAR_MAXSPEED, personID);
     273              : }
     274              : 
     275              : 
     276              : double
     277            0 : Person::getMaxSpeedLat(const std::string& personID) {
     278            0 :     return Dom::getDouble(libsumo::VAR_MAXSPEED_LAT, personID);
     279              : }
     280              : 
     281              : 
     282              : std::string
     283            0 : Person::getLateralAlignment(const std::string& personID) {
     284            0 :     return Dom::getString(libsumo::VAR_LATALIGNMENT, personID);
     285              : }
     286              : 
     287              : 
     288              : double
     289            2 : Person::getWidth(const std::string& personID) {
     290            2 :     return Dom::getDouble(libsumo::VAR_WIDTH, personID);
     291              : }
     292              : 
     293              : 
     294              : double
     295            0 : Person::getHeight(const std::string& personID) {
     296            0 :     return Dom::getDouble(libsumo::VAR_HEIGHT, personID);
     297              : }
     298              : 
     299              : 
     300              : double
     301            0 : Person::getMass(const std::string& personID) {
     302            0 :     return Dom::getDouble(libsumo::VAR_MASS, personID);
     303              : }
     304              : 
     305              : 
     306              : int
     307            0 : Person::getPersonCapacity(const std::string& personID) {
     308            0 :     return Dom::getInt(libsumo::VAR_PERSON_CAPACITY, personID);
     309              : }
     310              : 
     311              : 
     312              : double
     313            2 : Person::getBoardingDuration(const std::string& personID) {
     314            2 :     return Dom::getDouble(libsumo::VAR_BOARDING_DURATION, personID);
     315              : }
     316              : 
     317              : double
     318            0 : Person::getImpatience(const std::string& personID) {
     319            0 :     return Dom::getDouble(libsumo::VAR_IMPATIENCE, personID);
     320              : }
     321              : 
     322              : 
     323              : 
     324           33 : LIBTRACI_PARAMETER_IMPLEMENTATION(Person, PERSON)
     325              : 
     326              : 
     327              : void
     328            3 : Person::setSpeed(const std::string& personID, double speed) {
     329            3 :     Dom::setDouble(libsumo::VAR_SPEED, personID, speed);
     330            3 : }
     331              : 
     332              : 
     333              : void
     334            3 : Person::setType(const std::string& personID, const std::string& typeID) {
     335            3 :     Dom::setString(libsumo::VAR_TYPE, personID, typeID);
     336            3 : }
     337              : 
     338              : 
     339              : void
     340            0 : Person::setImpatience(const std::string& personID, double impatience) {
     341            0 :     Dom::setDouble(libsumo::VAR_IMPATIENCE, personID, impatience);
     342            0 : }
     343              : 
     344              : void
     345            0 : Person::setBoardingDuration(const std::string& personID, double boardingDuration) {
     346            0 :     Dom::setDouble(libsumo::VAR_BOARDING_DURATION, personID, boardingDuration);
     347            0 : }
     348              : 
     349              : void
     350           47 : Person::add(const std::string& personID, const std::string& edgeID, double pos, double departInSecs, const std::string typeID) {
     351           47 :     tcpip::Storage content;
     352           47 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     353           47 :     content.writeInt(4);
     354           47 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     355           47 :     content.writeString(typeID);
     356           47 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     357           47 :     content.writeString(edgeID);
     358           47 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     359           47 :     content.writeDouble(departInSecs);
     360           47 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     361           47 :     content.writeDouble(pos);
     362           47 :     Dom::set(libsumo::ADD, personID, &content);
     363           47 : }
     364              : 
     365              : 
     366              : void
     367            5 : Person::appendStage(const std::string& personID, const libsumo::TraCIStage& stage) {
     368            5 :     tcpip::Storage content;
     369            5 :     libsumo::StorageHelper::writeStage(content, stage);
     370            5 :     Dom::set(libsumo::APPEND_STAGE, personID, &content);
     371            5 : }
     372              : 
     373              : 
     374              : void
     375            2 : Person::replaceStage(const std::string& personID, const int stageIndex, const libsumo::TraCIStage& stage) {
     376            2 :     tcpip::Storage content;
     377            2 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     378            2 :     content.writeInt(2);
     379            2 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     380            2 :     content.writeInt(stageIndex);
     381            2 :     libsumo::StorageHelper::writeStage(content, stage);
     382            2 :     Dom::set(libsumo::REPLACE_STAGE, personID, &content);
     383            2 : }
     384              : 
     385              : 
     386              : void
     387            7 : Person::appendDrivingStage(const std::string& personID, const std::string& toEdge, const std::string& lines, const std::string& stopID) {
     388            7 :     tcpip::Storage content;
     389            7 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     390            7 :     content.writeInt(4);
     391            7 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     392            7 :     content.writeInt(libsumo::STAGE_DRIVING);
     393            7 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     394            7 :     content.writeString(toEdge);
     395            7 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     396            7 :     content.writeString(lines);
     397            7 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     398            7 :     content.writeString(stopID);
     399            7 :     Dom::set(libsumo::APPEND_STAGE, personID, &content);
     400            7 : }
     401              : 
     402              : 
     403              : void
     404            5 : Person::appendWaitingStage(const std::string& personID, double duration, const std::string& description, const std::string& stopID) {
     405            5 :     tcpip::Storage content;
     406            5 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     407            5 :     content.writeInt(4);
     408            5 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     409            5 :     content.writeInt(libsumo::STAGE_WAITING);
     410            5 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     411            5 :     content.writeDouble(duration);
     412            5 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     413            5 :     content.writeString(description);
     414            5 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     415            5 :     content.writeString(stopID);
     416            5 :     Dom::set(libsumo::APPEND_STAGE, personID, &content);
     417            5 : }
     418              : 
     419              : 
     420              : void
     421           44 : Person::appendWalkingStage(const std::string& personID, const std::vector<std::string>& edges, double arrivalPos, double duration, double speed, const std::string& stopID) {
     422           44 :     tcpip::Storage content;
     423           44 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     424           44 :     content.writeInt(6);
     425           44 :     content.writeUnsignedByte(libsumo::TYPE_INTEGER);
     426           44 :     content.writeInt(libsumo::STAGE_WALKING);
     427           44 :     content.writeUnsignedByte(libsumo::TYPE_STRINGLIST);
     428           44 :     content.writeStringList(edges);
     429           44 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     430           44 :     content.writeDouble(arrivalPos);
     431           44 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     432           44 :     content.writeDouble(duration);
     433           44 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     434           44 :     content.writeDouble(speed);
     435           44 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     436           44 :     content.writeString(stopID);
     437           44 :     Dom::set(libsumo::APPEND_STAGE, personID, &content);
     438           44 : }
     439              : 
     440              : 
     441              : void
     442           16 : Person::removeStage(const std::string& personID, int nextStageIndex) {
     443           16 :     Dom::setInt(libsumo::REMOVE_STAGE, personID, nextStageIndex);
     444           16 : }
     445              : 
     446              : 
     447              : void
     448          203 : Person::rerouteTraveltime(const std::string& personID) {
     449          203 :     tcpip::Storage content;
     450          203 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     451          203 :     content.writeInt(0);
     452          203 :     Dom::set(libsumo::CMD_REROUTE_TRAVELTIME, personID, &content);
     453          203 : }
     454              : 
     455              : 
     456              : void
     457            4 : Person::moveTo(const std::string& personID, const std::string& laneID, double pos, double posLat) {
     458            4 :     tcpip::Storage content;
     459            4 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     460            4 :     content.writeInt(3);
     461            4 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     462            4 :     content.writeString(laneID);
     463            4 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     464            4 :     content.writeDouble(pos);
     465            4 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     466            4 :     content.writeDouble(posLat);
     467            4 :     Dom::set(libsumo::VAR_MOVE_TO, personID, &content);
     468            4 : }
     469              : 
     470              : 
     471              : void
     472          515 : Person::moveToXY(const std::string& personID, const std::string& edgeID, const double x, const double y, double angle, const int keepRoute, double matchThreshold) {
     473          515 :     tcpip::Storage content;
     474          515 :     content.writeUnsignedByte(libsumo::TYPE_COMPOUND);
     475          515 :     content.writeInt(6);
     476          515 :     content.writeUnsignedByte(libsumo::TYPE_STRING);
     477          515 :     content.writeString(edgeID);
     478          515 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     479          515 :     content.writeDouble(x);
     480          515 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     481          515 :     content.writeDouble(y);
     482          515 :     content.writeUnsignedByte(libsumo::TYPE_DOUBLE);
     483          515 :     content.writeDouble(angle);
     484          515 :     content.writeUnsignedByte(libsumo::TYPE_BYTE);
     485          515 :     content.writeByte(keepRoute);
     486              :     StoHelp::writeTypedDouble(content, matchThreshold);
     487          515 :     Dom::set(libsumo::MOVE_TO_XY, personID, &content);
     488          515 : }
     489              : 
     490              : 
     491              : /** untested setter functions which alter the person's vtype ***/
     492              : 
     493              : void
     494            1 : Person::setLength(const std::string& personID, double length) {
     495            1 :     Dom::setDouble(libsumo::VAR_LENGTH, personID, length);
     496            1 : }
     497              : 
     498              : 
     499              : void
     500            0 : Person::setMaxSpeed(const std::string& personID, double speed) {
     501            0 :     Dom::setDouble(libsumo::VAR_MAXSPEED, personID, speed);
     502            0 : }
     503              : 
     504              : 
     505              : void
     506            0 : Person::setVehicleClass(const std::string& personID, const std::string& clazz) {
     507            0 :     Dom::setString(libsumo::VAR_VEHICLECLASS, personID, clazz);
     508            0 : }
     509              : 
     510              : 
     511              : void
     512            0 : Person::setShapeClass(const std::string& personID, const std::string& clazz) {
     513            0 :     Dom::setString(libsumo::VAR_SHAPECLASS, personID, clazz);
     514            0 : }
     515              : 
     516              : 
     517              : void
     518            0 : Person::setEmissionClass(const std::string& personID, const std::string& clazz) {
     519            0 :     Dom::setString(libsumo::VAR_EMISSIONCLASS, personID, clazz);
     520            0 : }
     521              : 
     522              : 
     523              : void
     524            1 : Person::setWidth(const std::string& personID, double width) {
     525            1 :     Dom::setDouble(libsumo::VAR_WIDTH, personID, width);
     526            1 : }
     527              : 
     528              : 
     529              : void
     530            1 : Person::setHeight(const std::string& personID, double height) {
     531            1 :     Dom::setDouble(libsumo::VAR_HEIGHT, personID, height);
     532            1 : }
     533              : 
     534              : 
     535              : void
     536            0 : Person::setMass(const std::string& personID, double mass) {
     537            0 :     Dom::setDouble(libsumo::VAR_HEIGHT, personID, mass);
     538            0 : }
     539              : 
     540              : 
     541              : void
     542            1 : Person::setMinGap(const std::string& personID, double minGap) {
     543            1 :     Dom::setDouble(libsumo::VAR_MINGAP, personID, minGap);
     544            1 : }
     545              : 
     546              : 
     547              : void
     548            0 : Person::setAccel(const std::string& personID, double accel) {
     549            0 :     Dom::setDouble(libsumo::VAR_ACCEL, personID, accel);
     550            0 : }
     551              : 
     552              : 
     553              : void
     554            0 : Person::setDecel(const std::string& personID, double decel) {
     555            0 :     Dom::setDouble(libsumo::VAR_DECEL, personID, decel);
     556            0 : }
     557              : 
     558              : 
     559              : void
     560            0 : Person::setEmergencyDecel(const std::string& personID, double decel) {
     561            0 :     Dom::setDouble(libsumo::VAR_EMERGENCY_DECEL, personID, decel);
     562            0 : }
     563              : 
     564              : 
     565              : void
     566            0 : Person::setApparentDecel(const std::string& personID, double decel) {
     567            0 :     Dom::setDouble(libsumo::VAR_APPARENT_DECEL, personID, decel);
     568            0 : }
     569              : 
     570              : 
     571              : void
     572            0 : Person::setImperfection(const std::string& personID, double imperfection) {
     573            0 :     Dom::setDouble(libsumo::VAR_IMPERFECTION, personID, imperfection);
     574            0 : }
     575              : 
     576              : 
     577              : void
     578            0 : Person::setTau(const std::string& personID, double tau) {
     579            0 :     Dom::setDouble(libsumo::VAR_TAU, personID, tau);
     580            0 : }
     581              : 
     582              : 
     583              : void
     584            0 : Person::setMinGapLat(const std::string& personID, double minGapLat) {
     585            0 :     Dom::setDouble(libsumo::VAR_MINGAP_LAT, personID, minGapLat);
     586            0 : }
     587              : 
     588              : 
     589              : void
     590            0 : Person::setMaxSpeedLat(const std::string& personID, double speed) {
     591            0 :     Dom::setDouble(libsumo::VAR_MAXSPEED_LAT, personID, speed);
     592            0 : }
     593              : 
     594              : 
     595              : void
     596            0 : Person::setLateralAlignment(const std::string& personID, const std::string& latAlignment) {
     597            0 :     Dom::setString(libsumo::VAR_LATALIGNMENT, personID, latAlignment);
     598            0 : }
     599              : 
     600              : 
     601              : void
     602            6 : Person::setSpeedFactor(const std::string& personID, double factor) {
     603            6 :     Dom::setDouble(libsumo::VAR_SPEED_FACTOR, personID, factor);
     604            6 : }
     605              : 
     606              : 
     607              : void
     608            0 : Person::setActionStepLength(const std::string& personID, double actionStepLength, bool resetActionOffset) {
     609            0 :     if (!resetActionOffset) {
     610            0 :         actionStepLength *= -1;
     611              :     }
     612            0 :     Dom::setDouble(libsumo::VAR_ACTIONSTEPLENGTH, personID, actionStepLength);
     613            0 : }
     614              : 
     615              : void
     616            3 : Person::remove(const std::string& personID, char reason) {
     617            3 :     tcpip::Storage content;
     618            3 :     content.writeUnsignedByte(libsumo::TYPE_BYTE);
     619            3 :     content.writeUnsignedByte(reason);
     620            3 :     Dom::set(libsumo::REMOVE, personID, &content);
     621            3 : }
     622              : 
     623              : 
     624              : void
     625            1 : Person::setColor(const std::string& personID, const libsumo::TraCIColor& color) {
     626            1 :     Dom::setCol(libsumo::VAR_COLOR, personID, color);
     627            1 : }
     628              : 
     629              : 
     630         8163 : LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(Person, PERSON)
     631              : 
     632              : 
     633              : }
     634              : 
     635              : 
     636              : /****************************************************************************/
        

Generated by: LCOV version 2.0-1