Eclipse SUMO - Simulation of Urban MObility
InductionLoop.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-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 /****************************************************************************/
15 // C++ TraCI client API implementation
16 /****************************************************************************/
17 #ifndef InductionLoop_h
18 #define InductionLoop_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <vector>
27 #include <libsumo/TraCIConstants.h>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class NamedRTree;
34 class MSInductLoop;
35 class PositionVector;
36 namespace libsumo {
37 struct TraCIVehicleData;
38 class VariableWrapper;
39 }
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 namespace libsumo {
51 public:
52  static std::vector<std::string> getIDList();
53  static int getIDCount();
54  static double getPosition(const std::string& detID);
55  static std::string getLaneID(const std::string& detID);
56  static int getLastStepVehicleNumber(const std::string& detID);
57  static double getLastStepMeanSpeed(const std::string& detID);
58  static std::vector<std::string> getLastStepVehicleIDs(const std::string& detID);
59  static double getLastStepOccupancy(const std::string& detID);
60  static double getLastStepMeanLength(const std::string& detID);
61  static double getTimeSinceDetection(const std::string& detID);
62  static std::vector<libsumo::TraCIVehicleData> getVehicleData(const std::string& detID);
63 
65 
69  static NamedRTree* getTree();
70 
75  static void storeShape(const std::string& id, PositionVector& shape);
76 
77  static std::shared_ptr<VariableWrapper> makeWrapper();
78 
79  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
80 
81 private:
82  static MSInductLoop* getDetector(const std::string& detID);
83 
84 private:
87 
88 private:
90  InductionLoop() = delete;
91 
92 };
93 }
94 
95 
96 #endif
97 
98 /****************************************************************************/
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:204
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:42
static std::string getLaneID(const std::string &detID)
A RT-tree for efficient storing of SUMO&#39;s Named objects.
Definition: NamedRTree.h:64
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:205
static std::shared_ptr< VariableWrapper > makeWrapper()
static void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
static std::vector< std::string > getIDList()
static double getLastStepOccupancy(const std::string &detID)
A list of positions.
static double getTimeSinceDetection(const std::string &detID)
static std::vector< std::string > getLastStepVehicleIDs(const std::string &detID)
static MSInductLoop * getDetector(const std::string &detID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: Edge.cpp:30
static int getLastStepVehicleNumber(const std::string &detID)
static std::vector< libsumo::TraCIVehicleData > getVehicleData(const std::string &detID)
static SubscriptionResults mySubscriptionResults
Definition: InductionLoop.h:85
InductionLoop()=delete
invalidated standard constructor
static double getLastStepMeanSpeed(const std::string &detID)
static LIBSUMO_SUBSCRIPTION_API NamedRTree * getTree()
Returns a tree filled with inductive loop instances.
static double getPosition(const std::string &detID)
static ContextSubscriptionResults myContextSubscriptionResults
Definition: InductionLoop.h:86
An unextended detector measuring at a fixed position on a fixed lane.
Definition: MSInductLoop.h:64
static double getLastStepMeanLength(const std::string &detID)