LCOV - code coverage report
Current view: top level - src/libtraci - MultiEntryExit.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 100.0 % 30 30
Test Date: 2024-10-24 15:46:30 Functions: 80.8 % 26 21

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2012-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    MultiEntryExit.cpp
      15              : /// @author  Daniel Krajzewicz
      16              : /// @author  Mario Krumnow
      17              : /// @author  Jakob Erdmann
      18              : /// @author  Michael Behrisch
      19              : /// @date    30.05.2012
      20              : ///
      21              : // C++ TraCI client API implementation
      22              : /****************************************************************************/
      23              : #include <config.h>
      24              : 
      25              : #define LIBTRACI 1
      26              : #include <libsumo/MultiEntryExit.h>
      27              : #include "Connection.h"
      28              : #include "Domain.h"
      29              : 
      30              : 
      31              : namespace libtraci {
      32              : 
      33              : typedef Domain<libsumo::CMD_GET_MULTIENTRYEXIT_VARIABLE, libsumo::CMD_SET_MULTIENTRYEXIT_VARIABLE> Dom;
      34              : 
      35              : 
      36              : // ===========================================================================
      37              : // static member definitions
      38              : // ===========================================================================
      39              : std::vector<std::string>
      40           67 : MultiEntryExit::getIDList() {
      41          133 :     return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");
      42              : }
      43              : 
      44              : 
      45              : int
      46            1 : MultiEntryExit::getIDCount() {
      47            2 :     return Dom::getInt(libsumo::ID_COUNT, "");
      48              : }
      49              : 
      50              : 
      51              : std::vector<std::string>
      52            1 : MultiEntryExit::getEntryLanes(const std::string& detID) {
      53            1 :     return Dom::getStringVector(libsumo::VAR_LANES, detID);
      54              : }
      55              : 
      56              : 
      57              : std::vector<std::string>
      58            1 : MultiEntryExit::getExitLanes(const std::string& detID) {
      59            1 :     return Dom::getStringVector(libsumo::VAR_EXIT_LANES, detID);
      60              : }
      61              : 
      62              : 
      63              : std::vector<double>
      64            1 : MultiEntryExit::getEntryPositions(const std::string& detID) {
      65            1 :     return Dom::getDoubleVector(libsumo::VAR_POSITION, detID);
      66              : }
      67              : 
      68              : 
      69              : std::vector<double>
      70            1 : MultiEntryExit::getExitPositions(const std::string& detID) {
      71            1 :     return Dom::getDoubleVector(libsumo::VAR_EXIT_POSITIONS, detID);
      72              : }
      73              : 
      74              : 
      75              : int
      76           41 : MultiEntryExit::getLastStepVehicleNumber(const std::string& detID) {
      77           41 :     return Dom::getInt(libsumo::LAST_STEP_VEHICLE_NUMBER, detID);
      78              : }
      79              : 
      80              : 
      81              : double
      82            1 : MultiEntryExit::getLastStepMeanSpeed(const std::string& detID) {
      83            1 :     return Dom::getDouble(libsumo::LAST_STEP_MEAN_SPEED, detID);
      84              : }
      85              : 
      86              : 
      87              : std::vector<std::string>
      88           41 : MultiEntryExit::getLastStepVehicleIDs(const std::string& detID) {
      89           41 :     return Dom::getStringVector(libsumo::LAST_STEP_VEHICLE_ID_LIST, detID);
      90              : }
      91              : 
      92              : 
      93              : int
      94            1 : MultiEntryExit::getLastStepHaltingNumber(const std::string& detID) {
      95            1 :     return Dom::getInt(libsumo::LAST_STEP_VEHICLE_HALTING_NUMBER, detID);
      96              : }
      97              : 
      98              : 
      99              : double
     100            2 : MultiEntryExit::getLastIntervalMeanTravelTime(const std::string& detID) {
     101            2 :     return Dom::getDouble(libsumo::VAR_LAST_INTERVAL_TRAVELTIME, detID);
     102              : }
     103              : 
     104              : 
     105              : double
     106            2 : MultiEntryExit::getLastIntervalMeanHaltsPerVehicle(const std::string& detID) {
     107            2 :     return Dom::getDouble(libsumo::VAR_LAST_INTERVAL_MEAN_HALTING_NUMBER, detID);
     108              : }
     109              : 
     110              : 
     111              : double
     112            2 : MultiEntryExit::getLastIntervalMeanTimeLoss(const std::string& detID) {
     113            2 :     return Dom::getDouble(libsumo::VAR_TIMELOSS, detID);
     114              : }
     115              : 
     116              : 
     117              : int
     118            2 : MultiEntryExit::getLastIntervalVehicleSum(const std::string& detID) {
     119            2 :     return Dom::getInt(libsumo::VAR_LAST_INTERVAL_VEHICLE_NUMBER, detID);
     120              : }
     121              : 
     122              : 
     123            3 : LIBTRACI_PARAMETER_IMPLEMENTATION(MultiEntryExit, MULTIENTRYEXIT)
     124          111 : LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(MultiEntryExit, MULTIENTRYEXIT)
     125              : 
     126              : 
     127              : }  // namespace libtraci
     128              : 
     129              : /****************************************************************************/
        

Generated by: LCOV version 2.0-1