Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2012-2025 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 : /****************************************************************************/
14 : /// @file Calibrator.h
15 : /// @author Jakob Erdmann
16 : /// @date 16.03.2020
17 : ///
18 : // C++ TraCI client API implementation
19 : /****************************************************************************/
20 : #pragma once
21 : #include <vector>
22 : #include <libsumo/TraCIDefs.h>
23 :
24 :
25 : // ===========================================================================
26 : // class declarations
27 : // ===========================================================================
28 : #ifndef LIBTRACI
29 : class MSCalibrator;
30 : #endif
31 :
32 :
33 : // ===========================================================================
34 : // class definitions
35 : // ===========================================================================
36 : /**
37 : * @class Calibrator
38 : * @brief C++ TraCI client API implementation
39 : */
40 :
41 : namespace LIBSUMO_NAMESPACE {
42 : class Calibrator {
43 : public:
44 : static std::string getEdgeID(const std::string& calibratorID);
45 : static std::string getLaneID(const std::string& calibratorID);
46 : static double getVehsPerHour(const std::string& calibratorID);
47 : static double getSpeed(const std::string& calibratorID);
48 : static std::string getTypeID(const std::string& calibratorID);
49 : static double getBegin(const std::string& calibratorID);
50 : static double getEnd(const std::string& calibratorID);
51 : static std::string getRouteID(const std::string& calibratorID);
52 : static std::string getRouteProbeID(const std::string& calibratorID);
53 : static std::vector<std::string> getVTypes(const std::string& calibratorID);
54 : static int getPassed(const std::string& calibratorID);
55 : static int getInserted(const std::string& calibratorID);
56 : static int getRemoved(const std::string& calibratorID);
57 :
58 : LIBSUMO_ID_PARAMETER_API
59 0 : LIBSUMO_SUBSCRIPTION_API
60 :
61 : static void setFlow(const std::string& calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string& typeID,
62 : const std::string& routeID,
63 : const std::string& departLane = "first",
64 : const std::string& departSpeed = "max");
65 :
66 : #ifndef LIBTRACI
67 : #ifndef SWIG
68 : static std::shared_ptr<VariableWrapper> makeWrapper();
69 :
70 : static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);
71 :
72 : static MSCalibrator* getCalibrator(const std::string& id);
73 :
74 : private:
75 : static SubscriptionResults mySubscriptionResults;
76 : static ContextSubscriptionResults myContextSubscriptionResults;
77 : #endif
78 : #endif
79 :
80 : /// @brief invalidated standard constructor
81 : Calibrator() = delete;
82 : };
83 :
84 : }
|