Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
LaneArea.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 MSE2Collector;
31class NamedRTree;
32class PositionVector;
33#endif
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
43namespace LIBSUMO_NAMESPACE {
44class LaneArea {
45public:
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
57 static double getIntervalOccupancy(const std::string& detID);
58 static double getIntervalMeanSpeed(const std::string& detID);
59 static double getIntervalMaxJamLengthInMeters(const std::string& detID);
60 static int getIntervalVehicleNumber(const std::string& detID);
61
62 static double getLastIntervalOccupancy(const std::string& detID);
63 static double getLastIntervalMeanSpeed(const std::string& detID);
64 static double getLastIntervalMaxJamLengthInMeters(const std::string& detID);
65 static int getLastIntervalVehicleNumber(const std::string& detID);
66
67 static void overrideVehicleNumber(const std::string& detID, int vehNum);
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 MSE2Collector* getDetector(const std::string& detID);
92
93private:
94private:
96 static SubscriptionResults mySubscriptionResults;
97 static ContextSubscriptionResults myContextSubscriptionResults;
98#endif
99#endif
100
101private:
103 LaneArea() = delete;
104
105};
106}
#define LIBSUMO_ID_PARAMETER_API
Definition TraCIDefs.h:116
#define LIBSUMO_SUBSCRIPTION_API
Definition TraCIDefs.h:62
LaneArea()=delete
invalidated standard constructor
static std::shared_ptr< VariableWrapper > makeWrapper()
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API NamedRTree * getTree()
Returns a tree filled with inductive loop instances.
static SubscriptionResults mySubscriptionResults
Definition LaneArea.h:96
static ContextSubscriptionResults myContextSubscriptionResults
Definition LaneArea.h:97
static double getLastStepOccupancy(const std::string &detID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static double getLastIntervalMeanSpeed(const std::string &detID)
static double getLength(const std::string &detID)
static int getLastStepVehicleNumber(const std::string &detID)
static int getLastIntervalVehicleNumber(const std::string &detID)
static double getLastIntervalOccupancy(const std::string &detID)
static void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
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 NamedRTree * myTree
Definition LaneArea.h:95
static int getJamLengthVehicle(const std::string &detID)
static double getIntervalMeanSpeed(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 void overrideVehicleNumber(const std::string &detID, int vehNum)
static double getLastIntervalMaxJamLengthInMeters(const std::string &detID)
static int getIntervalVehicleNumber(const std::string &detID)
static MSE2Collector * getDetector(const std::string &detID)
static double getIntervalMaxJamLengthInMeters(const std::string &detID)
static double getIntervalOccupancy(const std::string &detID)
An areal detector corresponding to a sequence of consecutive lanes.
A RT-tree for efficient storing of SUMO's Named objects.
Definition NamedRTree.h:61
A list of positions.