SUMO - Simulation of Urban MObility
GNERouteProbReroute.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 GNERouteProbReroute_h
20 #define GNERouteProbReroute_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 // ===========================================================================
49 
55 public:
57  GNERouteProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog);
58 
60  GNERouteProbReroute(GNERerouterInterval* rerouterIntervalParent, const std::string& newRouteId, double probability);
61 
64 
65  // @brief write destiny probability reroute
66  void writeRouteProbReroute(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 
99  std::string myNewRouteId;
100 
103 
104 private:
106  void setAttribute(SumoXMLAttr key, const std::string& value);
107 
109  GNERouteProbReroute(const GNERouteProbReroute&) = delete;
110 
113 };
114 
115 #endif
116 
117 /****************************************************************************/
Dialog for edit rerouter intervals.
std::string myNewRouteId
id of new route
void writeRouteProbReroute(OutputDevice &device) const
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double myProbability
probability with which a vehicle will use the given edge as destination
GNERouteProbReroute & operator=(const GNERouteProbReroute &)=delete
Invalidated assignment operator.
GNERerouterInterval * getRerouterIntervalParent() const
get rerouter interval parent
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
~GNERouteProbReroute()
destructor
GNERerouterInterval * myRerouterIntervalParent
reference to rerouter interval parent
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
GNERouteProbReroute(GNERerouterIntervalDialog *rerouterIntervalDialog)
constructor (Used in GNERerouterIntervalDialog)
bool isValid(SumoXMLAttr key, const std::string &value)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)