Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNECalibrator.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 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// Calibrator over edge or lane
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
29class GNERouteProbe;
31class GNERoute;
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
36
38
39public:
42
57 GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
58 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
59
74 GNECalibrator(const std::string& id, GNENet* net, FileBucket* fileBucket, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
75 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
76
79
82
84 GNEMoveElement* getMoveElement() const override;
85
87 Parameterised* getParameters() override;
88
90 const Parameterised* getParameters() const override;
91
93
96
100 void writeAdditional(OutputDevice& device) const override;
101
103 bool isAdditionalValid() const override;
104
106 std::string getAdditionalProblem() const override;
107
109 void fixAdditionalProblem() override;
110
112
115
117 bool checkDrawMoveContour() const override;
118
120
122 void openAdditionalDialog(FXWindow* restoringFocusWindow) override;
123
126
128 void updateGeometry() override;
129
131 Position getPositionInView() const override;
132
134 void updateCenteringBoundary(const bool updateGrid) override;
135
137 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
138
140
143
147 std::string getParentName() const override;
148
153 void drawGL(const GUIVisualizationSettings& s) const override;
154
156
159
160 /* @brief method for getting the Attribute of an XML key
161 * @param[in] key The attribute key
162 * @return string with the value associated to key
163 */
164 std::string getAttribute(SumoXMLAttr key) const override;
165
166 /* @brief method for getting the Attribute of an XML key in double format
167 * @param[in] key The attribute key
168 * @return double with the value associated to key
169 */
170 double getAttributeDouble(SumoXMLAttr key) const override;
171
172 /* @brief method for getting the Attribute of an XML key in position format
173 * @param[in] key The attribute key
174 * @return position with the value associated to key
175 */
176 Position getAttributePosition(SumoXMLAttr key) const override;
177
178 /* @brief method for getting the Attribute of an XML key in positionVector format
179 * @param[in] key The attribute key
180 * @return positionVector with the value associated to key
181 */
183
184 /* @brief method for setting the attribute and letting the object perform additional changes
185 * @param[in] key The attribute key
186 * @param[in] value The new value
187 * @param[in] undoList The undoList on which to register changes
188 */
189 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
190
191 /* @brief method for checking if the key and their correspond attribute are valids
192 * @param[in] key The attribute key
193 * @param[in] value The value associated to key key
194 * @return true if the value is valid, false in other case
195 */
196 bool isValid(SumoXMLAttr key, const std::string& value) override;
197
199 std::string getPopUpID() const override;
200
202 std::string getHierarchyName() const override;
203
205
206protected:
209
212
214 std::string myOutput;
215
217 double myJamThreshold = 0;
218
220 std::vector<std::string> myVTypes;
221
223 std::vector<GUIGeometry> myEdgeCalibratorGeometries;
224
226 std::vector<GNEContour*>* myEdgeCalibratorContours;
227
228private:
231 const double exaggeration, const Position& pos, const double rot,
232 const int symbolIndex) const;
233
235 void setAttribute(SumoXMLAttr key, const std::string& value) override;
236
238 GNECalibrator(const GNECalibrator&) = delete;
239
242};
long long int SUMOTime
Definition GUI.h:36
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawCalibratorSymbol(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const Position &pos, const double rot, const int symbolIndex) const
draw calibrator symbol
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
GNECalibrator & operator=(const GNECalibrator &)=delete
Invalidated assignment operator.
std::string getParentName() const override
Returns the name of the parent object.
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
void openAdditionalDialog(FXWindow *restoringFocusWindow) override
open Calibrator Dialog
std::vector< GNEContour * > * myEdgeCalibratorContours
edge calibrator contours
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibrator
double getAttributeDouble(SumoXMLAttr key) const override
~GNECalibrator()
Destructor.
SUMOTime myFrequency
Frequency of calibrator.
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
std::string getAttribute(SumoXMLAttr key) const override
double myPositionOverLane
position over Lane
std::vector< std::string > myVTypes
vTypes
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool checkDrawMoveContour() const override
check if draw move contour (red)
Position getPositionInView() const override
Returns position of additional in view.
GNECalibrator(const GNECalibrator &)=delete
Invalidated copy constructor.
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
Parameterised * getParameters() override
get parameters associated with this calibrator
std::vector< GUIGeometry > myEdgeCalibratorGeometries
edge calibrator geometries
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.