SUMO - Simulation of Urban MObility
GNEDestProbReroute.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 GNEDestProbReroute_h
20 #define GNEDestProbReroute_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 <vector>
35 
36 #include "GNEAttributeCarrier.h"
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 
42 class GNEEdge;
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
54 
55 public:
57  GNEDestProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog);
58 
60  GNEDestProbReroute(GNERerouterInterval* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability);
61 
64 
65  // @brief write destiny probability reroute
66  void writeDestProbReroute(OutputDevice& device) const;
67 
70 
73  /* @brief method for getting the Attribute of an XML key
74  * @param[in] key The attribute key
75  * @return string with the value associated to key
76  */
77  std::string getAttribute(SumoXMLAttr key) const;
78 
79  /* @brief method for setting the attribute and letting the object perform additional changes
80  * @param[in] key The attribute key
81  * @param[in] value The new value
82  * @param[in] undoList The undoList on which to register changes
83  */
84  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
85 
86  /* @brief method for checking if the key and their correspond attribute are valids
87  * @param[in] key The attribute key
88  * @param[in] value The value asociated to key key
89  * @return true if the value is valid, false in other case
90  */
91  bool isValid(SumoXMLAttr key, const std::string& value);
93 
94 protected:
97 
100 
103 
104 private:
106  void setAttribute(SumoXMLAttr key, const std::string& value);
107 
109  GNEDestProbReroute(const GNEDestProbReroute&) = delete;
110 
113 };
114 
115 #endif
116 
117 /****************************************************************************/
GNERerouterInterval * getRerouterIntervalParent() const
get rerouter interval parent
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
Dialog for edit rerouter intervals.
double myProbability
probability with which a vehicle will use the given edge as destination
GNEDestProbReroute(GNERerouterIntervalDialog *rerouterIntervalDialog)
constructor (Used in GNERerouterIntervalDialog)
GNEEdge * myNewEdgeDestination
id of new edge destination
bool isValid(SumoXMLAttr key, const std::string &value)
GNERerouterInterval * myRerouterIntervalParent
reference to rerouter interval parent
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void writeDestProbReroute(OutputDevice &device) const
~GNEDestProbReroute()
destructor
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
GNEDestProbReroute & operator=(const GNEDestProbReroute &)=delete
Invalidated assignment operator.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70