1 /****************************************************************************/ 2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo 3 // Copyright (C) 2017-2019 German Aerospace Center (DLR) and others. 4 // This program and the accompanying materials 5 // are made available under the terms of the Eclipse Public License v2.0 6 // which accompanies this distribution, and is available at 7 // http://www.eclipse.org/legal/epl-v20.html 8 // SPDX-License-Identifier: EPL-2.0 9 /****************************************************************************/ 10 /// @file LaneArea.h 11 /// @author Michael Behrisch 12 /// @date 15.03.2017 13 /// @version $Id$ 14 /// 15 // C++ TraCI client API implementation 16 /****************************************************************************/ 17 #ifndef LaneArea_h 18 #define LaneArea_h 19 20 21 // =========================================================================== 22 // included modules 23 // =========================================================================== 24 #include <config.h> 25 26 #include <vector> 27 28 29 // =========================================================================== 30 // class declarations 31 // =========================================================================== 32 class MSE2Collector; 33 34 35 // =========================================================================== 36 // class definitions 37 // =========================================================================== 38 /** 39 * @class LaneArea 40 * @brief C++ TraCI client API implementation 41 */ 42 namespace libsumo { 43 class LaneArea { 44 public: 45 static std::vector<std::string> getIDList(); 46 static int getIDCount(); 47 static int getJamLengthVehicle(const std::string& detID); 48 static double getJamLengthMeters(const std::string& detID); 49 static double getLastStepMeanSpeed(const std::string& detID); 50 static std::vector<std::string> getLastStepVehicleIDs(const std::string& detID); 51 static double getLastStepOccupancy(const std::string& detID); 52 static double getPosition(const std::string& detID); 53 static std::string getLaneID(const std::string& detID); 54 static double getLength(const std::string& detID); 55 static int getLastStepVehicleNumber(const std::string& detID); 56 static int getLastStepHaltingNumber(const std::string& detID); 57 58 LIBSUMO_SUBSCRIPTION_API 59 60 static std::shared_ptr<VariableWrapper> makeWrapper(); 61 62 static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); 63 64 private: 65 static MSE2Collector* getDetector(const std::string& detID); 66 67 private: 68 static SubscriptionResults mySubscriptionResults; 69 static ContextSubscriptionResults myContextSubscriptionResults; 70 71 /// @brief invalidated standard constructor 72 LaneArea() = delete; 73 74 }; 75 } 76 77 78 #endif 79 80 /****************************************************************************/ 81