SUMO - Simulation of Urban MObility
GNEDetectorE2.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 #ifndef GNEDetectorE2_h
20 #define GNEDetectorE2_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEDetector.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNEDetectorE2 : public GNEDetector {
43 
44 public:
59  GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, double length, double freq, const std::string& filename,
60  bool cont, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos);
61 
64 
68  void writeAdditional(OutputDevice& device) const;
69 
71  bool isDetectorPositionFixed() const;
72 
74  double getAbsoluteLenght() const;
75 
79  void updateGeometry();
81 
84 
88  void drawGL(const GUIVisualizationSettings& s) const;
90 
93  /* @brief method for getting the Attribute of an XML key
94  * @param[in] key The attribute key
95  * @return string with the value associated to key
96  */
97  std::string getAttribute(SumoXMLAttr key) const;
98 
99  /* @brief method for setting the attribute and letting the object perform additional changes
100  * @param[in] key The attribute key
101  * @param[in] value The new value
102  * @param[in] undoList The undoList on which to register changes
103  */
104  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
105 
106  /* @brief method for checking if the key and their correspond attribute are valids
107  * @param[in] key The attribute key
108  * @param[in] value The value asociated to key key
109  * @return true if the value is valid, false in other case
110  */
111  bool isValid(SumoXMLAttr key, const std::string& value);
113 
114 protected:
117 
119  bool myCont;
120 
123 
126 
129 
130 private:
132  void setAttribute(SumoXMLAttr key, const std::string& value);
133 
135  GNEDetectorE2(const GNEDetectorE2&) = delete;
136 
138  GNEDetectorE2& operator=(const GNEDetectorE2&) = delete;
139 };
140 
141 #endif
142 /****************************************************************************/
bool isDetectorPositionFixed() const
check if Position of detector is fixed
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
GNEDetectorE2 & operator=(const GNEDetectorE2 &)=delete
Invalidated assignment operator.
Stores the information about how to visualize structures.
double myRelativeLength
relative length [0,1]
bool myCont
attribute to enable or disable splitByType
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double getAbsoluteLenght() const
get absolute lenght
void updateGeometry()
update pre-computed geometry information
~GNEDetectorE2()
Destructor.
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
GNEDetectorE2(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, double length, double freq, const std::string &filename, bool cont, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos)
Constructor.
double myJamThreshold
The minimum distance to the next standing vehicle in order to make this vehicle count as a participan...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.