Eclipse SUMO - Simulation of Urban MObility
LaneArea.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-2020 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 /****************************************************************************/
18 // C++ TraCI client API implementation
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <string>
24 #include <vector>
25 #include <libsumo/TraCIDefs.h>
26 
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 #ifndef LIBTRACI
32 class MSE2Collector;
33 #endif
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 namespace LIBSUMO_NAMESPACE {
44 class LaneArea {
45 public:
46  static int getJamLengthVehicle(const std::string& detID);
47  static double getJamLengthMeters(const std::string& detID);
48  static double getLastStepMeanSpeed(const std::string& detID);
49  static std::vector<std::string> getLastStepVehicleIDs(const std::string& detID);
50  static double getLastStepOccupancy(const std::string& detID);
51  static double getPosition(const std::string& detID);
52  static std::string getLaneID(const std::string& detID);
53  static double getLength(const std::string& detID);
54  static int getLastStepVehicleNumber(const std::string& detID);
55  static int getLastStepHaltingNumber(const std::string& detID);
56 
59 
60 #ifndef LIBTRACI
61  static std::shared_ptr<VariableWrapper> makeWrapper();
62 
63  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
64 
65 private:
66  static MSE2Collector* getDetector(const std::string& detID);
67 
68 private:
71 #endif
72 
73 private:
75  LaneArea() = delete;
76 
77 };
78 }
#define LIBSUMO_ID_PARAMETER_API
Definition: TraCIDefs.h:97
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:44
LaneArea()=delete
invalidated standard constructor
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
static SubscriptionResults mySubscriptionResults
Definition: LaneArea.h:69
static ContextSubscriptionResults myContextSubscriptionResults
Definition: LaneArea.h:70
static double getLastStepOccupancy(const std::string &detID)
static double getLength(const std::string &detID)
static int getLastStepVehicleNumber(const std::string &detID)
static double getJamLengthMeters(const std::string &detID)
static std::vector< std::string > getLastStepVehicleIDs(const std::string &detID)
static int getLastStepHaltingNumber(const std::string &detID)
static int getJamLengthVehicle(const std::string &detID)
static std::string getLaneID(const std::string &detID)
static double getPosition(const std::string &detID)
static double getLastStepMeanSpeed(const std::string &detID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
static MSE2Collector * getDetector(const std::string &detID)
An areal detector corresponding to a sequence of consecutive lanes.
Definition: MSE2Collector.h:79
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:250
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:251