Eclipse SUMO - Simulation of Urban MObility
Calibrator.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2022 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 <vector>
22 #include <libsumo/TraCIDefs.h>
23 #ifndef LIBTRACI
25 #endif
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
36 namespace LIBSUMO_NAMESPACE {
37 class Calibrator {
38 public:
39  static std::string getEdgeID(const std::string& calibratorID);
40  static std::string getLaneID(const std::string& calibratorID);
41  static double getVehsPerHour(const std::string& calibratorID);
42  static double getSpeed(const std::string& calibratorID);
43  static std::string getTypeID(const std::string& calibratorID);
44  static double getBegin(const std::string& calibratorID);
45  static double getEnd(const std::string& calibratorID);
46  static std::string getRouteID(const std::string& calibratorID);
47  static std::string getRouteProbeID(const std::string& calibratorID);
48  static std::vector<std::string> getVTypes(const std::string& routeID);
49  static int getPassed(const std::string& calibratorID);
50  static int getInserted(const std::string& calibratorID);
51  static int getRemoved(const std::string& calibratorID);
52 
55 
56  static void setFlow(const std::string& calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string& typeID,
57  const std::string& routeID,
58  const std::string& departLane = "first",
59  const std::string& departSpeed = "max");
60 
61 #ifndef LIBTRACI
62 #ifndef SWIG
63  static std::shared_ptr<VariableWrapper> makeWrapper();
64 
65  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);
66 
67 private:
68  static MSCalibrator* getCalibrator(const std::string& id);
70 
71 private:
74 #endif
75 #endif
76 
78  Calibrator() = delete;
79 };
80 
81 }
#define LIBSUMO_ID_PARAMETER_API
Definition: TraCIDefs.h:108
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:56
static int getPassed(const std::string &calibratorID)
static MSCalibrator * getCalibrator(const std::string &id)
Calibrator()=delete
invalidated standard constructor
static double getSpeed(const std::string &calibratorID)
static int getRemoved(const std::string &calibratorID)
static MSCalibrator::AspiredState getCalibratorState(const MSCalibrator *c)
static std::string getRouteID(const std::string &calibratorID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static double getEnd(const std::string &calibratorID)
static std::string getEdgeID(const std::string &calibratorID)
static double getVehsPerHour(const std::string &calibratorID)
static std::vector< std::string > getVTypes(const std::string &routeID)
static std::string getRouteProbeID(const std::string &calibratorID)
static SubscriptionResults mySubscriptionResults
Definition: Calibrator.h:72
static std::string getTypeID(const std::string &calibratorID)
static double getBegin(const std::string &calibratorID)
static std::string getLaneID(const std::string &calibratorID)
static std::shared_ptr< VariableWrapper > makeWrapper()
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void setFlow(const std::string &calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string &typeID, const std::string &routeID, const std::string &departLane="first", const std::string &departSpeed="max")
static ContextSubscriptionResults myContextSubscriptionResults
Definition: Calibrator.h:73
static int getInserted(const std::string &calibratorID)
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:48
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:279
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:278