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-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/****************************************************************************/
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
56 GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
57 const std::string& output, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
58
73 GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name,
74 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
75
89 GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
90 const std::string& output, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
91
106 GNECalibrator(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, double pos, SUMOTime frequency, const std::string& name,
107 const std::string& output, GNEAdditional* routeProbe, const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);
108
111
114
116 GNEMoveElement* getMoveElement() const override;
117
119 Parameterised* getParameters() override;
120
122 const Parameterised* getParameters() const override;
123
125
128
132 void writeAdditional(OutputDevice& device) const;
133
135 bool isAdditionalValid() const;
136
138 std::string getAdditionalProblem() const;
139
142
144
147
149 bool checkDrawMoveContour() const override;
150
152
155
158
160 void updateGeometry() override;
161
164
166 void updateCenteringBoundary(const bool updateGrid);
167
169 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
170
172
175
179 std::string getParentName() const;
180
185 void drawGL(const GUIVisualizationSettings& s) const;
186
188
191
192 /* @brief method for getting the Attribute of an XML key
193 * @param[in] key The attribute key
194 * @return string with the value associated to key
195 */
196 std::string getAttribute(SumoXMLAttr key) const override;
197
198 /* @brief method for getting the Attribute of an XML key in double format
199 * @param[in] key The attribute key
200 * @return double with the value associated to key
201 */
202 double getAttributeDouble(SumoXMLAttr key) const override;
203
204 /* @brief method for getting the Attribute of an XML key in position format
205 * @param[in] key The attribute key
206 * @return position with the value associated to key
207 */
208 Position getAttributePosition(SumoXMLAttr key) const override;
209
210 /* @brief method for getting the Attribute of an XML key in positionVector format
211 * @param[in] key The attribute key
212 * @return positionVector with the value associated to key
213 */
215
216 /* @brief method for setting the attribute and letting the object perform additional changes
217 * @param[in] key The attribute key
218 * @param[in] value The new value
219 * @param[in] undoList The undoList on which to register changes
220 */
221 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
222
223 /* @brief method for checking if the key and their correspond attribute are valids
224 * @param[in] key The attribute key
225 * @param[in] value The value associated to key key
226 * @return true if the value is valid, false in other case
227 */
228 bool isValid(SumoXMLAttr key, const std::string& value) override;
229
231 std::string getPopUpID() const override;
232
234 std::string getHierarchyName() const override;
235
237
238protected:
241
244
246 std::string myOutput;
247
249 double myJamThreshold = 0;
250
252 std::vector<std::string> myVTypes;
253
255 std::vector<GUIGeometry> myEdgeCalibratorGeometries;
256
258 std::vector<GNEContour*>* myEdgeCalibratorContours;
259
260private:
263 const double exaggeration, const Position& pos, const double rot,
264 const int symbolIndex) const;
265
267 void setAttribute(SumoXMLAttr key, const std::string& value) override;
268
270 GNECalibrator(const GNECalibrator&) = delete;
271
274};
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
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Position getPositionInView() const
Returns position of additional in view.
GNECalibrator & operator=(const GNECalibrator &)=delete
Invalidated assignment operator.
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
double myJamThreshold
jamThreshold
std::string myOutput
output of calibrator
std::vector< GNEContour * > * myEdgeCalibratorContours
edge calibrator contours
std::string getParentName() const
Returns the name of the parent object.
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this calibrator
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
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 setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
bool checkDrawMoveContour() const override
check if draw move contour (red)
GNECalibrator(const GNECalibrator &)=delete
Invalidated copy constructor.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Parameterised * getParameters() override
get parameters associated with this calibrator
void openAdditionalDialog()
open Calibrator Dialog
std::vector< GUIGeometry > myEdgeCalibratorGeometries
edge calibrator geometries
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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.