Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
InductionLoop.h
Go to the documentation of this file.
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/****************************************************************************/
18// C++ TraCI client API implementation
19/****************************************************************************/
20#pragma once
21#include <string>
22#include <vector>
23#include <libsumo/TraCIDefs.h>
24
25
26// ===========================================================================
27// class declarations
28// ===========================================================================
29#ifndef LIBTRACI
30class NamedRTree;
31class MSInductLoop;
32class MEInductLoop;
33class PositionVector;
34#endif
35
36
37// ===========================================================================
38// class definitions
39// ===========================================================================
44namespace LIBSUMO_NAMESPACE {
46public:
47 static double getPosition(const std::string& loopID);
48 static std::string getLaneID(const std::string& loopID);
49 static int getLastStepVehicleNumber(const std::string& loopID);
50 static double getLastStepMeanSpeed(const std::string& loopID);
51 static std::vector<std::string> getLastStepVehicleIDs(const std::string& loopID);
52 static double getLastStepOccupancy(const std::string& loopID);
53 static double getLastStepMeanLength(const std::string& loopID);
54 static double getTimeSinceDetection(const std::string& loopID);
55 static std::vector<libsumo::TraCIVehicleData> getVehicleData(const std::string& loopID);
56
57 static double getIntervalOccupancy(const std::string& loopID);
58 static double getIntervalMeanSpeed(const std::string& loopID);
59 static int getIntervalVehicleNumber(const std::string& loopID);
60 static std::vector<std::string> getIntervalVehicleIDs(const std::string& loopID);
61
62 static double getLastIntervalOccupancy(const std::string& loopID);
63 static double getLastIntervalMeanSpeed(const std::string& loopID);
64 static int getLastIntervalVehicleNumber(const std::string& loopID);
65 static std::vector<std::string> getLastIntervalVehicleIDs(const std::string& loopID);
66
67 static void overrideTimeSinceDetection(const std::string& loopID, double time);
68
71
72#ifndef LIBTRACI
73#ifndef SWIG
77 static NamedRTree* getTree();
78 static void cleanup();
79
84 static void storeShape(const std::string& id, PositionVector& shape);
85
86 static std::shared_ptr<VariableWrapper> makeWrapper();
87
88 static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);
89
90private:
91 static MSInductLoop* getDetector(const std::string& loopID);
92 static MEInductLoop* getMEDetector(const std::string& loopID);
93
94private:
95 static SubscriptionResults mySubscriptionResults;
96 static ContextSubscriptionResults myContextSubscriptionResults;
98#endif
99#endif
100
101private:
103 InductionLoop() = delete;
104
105};
106}
#define LIBSUMO_ID_PARAMETER_API
Definition TraCIDefs.h:116
#define LIBSUMO_SUBSCRIPTION_API
Definition TraCIDefs.h:62
static std::string getLaneID(const std::string &loopID)
static ContextSubscriptionResults myContextSubscriptionResults
static std::vector< std::string > getLastIntervalVehicleIDs(const std::string &loopID)
static std::shared_ptr< VariableWrapper > makeWrapper()
static std::vector< std::string > getIntervalVehicleIDs(const std::string &loopID)
static SubscriptionResults mySubscriptionResults
static int getIntervalVehicleNumber(const std::string &loopID)
InductionLoop()=delete
invalidated standard constructor
static MEInductLoop * getMEDetector(const std::string &loopID)
static void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
static double getLastIntervalOccupancy(const std::string &loopID)
static MSInductLoop * getDetector(const std::string &loopID)
static double getTimeSinceDetection(const std::string &loopID)
static std::vector< std::string > getLastStepVehicleIDs(const std::string &loopID)
static double getLastStepOccupancy(const std::string &loopID)
static std::vector< libsumo::TraCIVehicleData > getVehicleData(const std::string &loopID)
static int getLastStepVehicleNumber(const std::string &loopID)
static double getLastStepMeanSpeed(const std::string &loopID)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API NamedRTree * getTree()
Returns a tree filled with inductive loop instances.
static double getLastIntervalMeanSpeed(const std::string &loopID)
static void overrideTimeSinceDetection(const std::string &loopID, double time)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static double getLastStepMeanLength(const std::string &loopID)
static double getIntervalOccupancy(const std::string &loopID)
static double getPosition(const std::string &loopID)
static int getLastIntervalVehicleNumber(const std::string &loopID)
static double getIntervalMeanSpeed(const std::string &loopID)
An induction loop for mesoscopic simulation.
An unextended detector measuring at a fixed position on a fixed lane.
A RT-tree for efficient storing of SUMO's Named objects.
Definition NamedRTree.h:61
A list of positions.