SUMO - Simulation of Urban MObility
GNEDetectorE2.h
Go to the documentation of this file.
1 /****************************************************************************/
7 //
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEDetectorE2_h
21 #define GNEDetectorE2_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEDetector.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNEDetector;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class GNEDetectorE2 : public GNEDetector {
48 public:
63  GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, double length, double freq, const std::string& filename,
64  bool cont, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos);
65 
68 
73  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const;
74 
76  bool isDetectorPositionFixed() const;
77 
79  double getAbsoluteLenght() const;
80 
84  void updateGeometry();
86 
89 
93  void drawGL(const GUIVisualizationSettings& s) const;
95 
98  /* @brief method for getting the Attribute of an XML key
99  * @param[in] key The attribute key
100  * @return string with the value associated to key
101  */
102  std::string getAttribute(SumoXMLAttr key) const;
103 
104  /* @brief method for setting the attribute and letting the object perform additional changes
105  * @param[in] key The attribute key
106  * @param[in] value The new value
107  * @param[in] undoList The undoList on which to register changes
108  */
109  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
110 
111  /* @brief method for checking if the key and their correspond attribute are valids
112  * @param[in] key The attribute key
113  * @param[in] value The value asociated to key key
114  * @return true if the value is valid, false in other case
115  */
116  bool isValid(SumoXMLAttr key, const std::string& value);
118 
119 protected:
122 
124  bool myCont;
125 
128 
131 
134 
135 private:
137  void setAttribute(SumoXMLAttr key, const std::string& value);
138 
140  GNEDetectorE2(const GNEDetectorE2&) = delete;
141 
143  GNEDetectorE2& operator=(const GNEDetectorE2&) = delete;
144 };
145 
146 #endif
147 /****************************************************************************/
GNEDetectorE2 & operator=(const GNEDetectorE2 &)=delete
Invalidated assignment operator.
Stores the information about how to visualize structures.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
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:54
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.
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...
bool isDetectorPositionFixed() const
check if Position of detector is fixed
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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...
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
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...
double getAbsoluteLenght() const
get absolute lenght