SUMO - Simulation of Urban MObility
GNERerouterInterval.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 GNERerouterInterval_h
20 #define GNERerouterInterval_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 "GNEAttributeCarrier.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 
38 class GNERerouter;
39 class GNERerouterDialog;
41 class GNEClosingReroute;
42 class GNEDestProbReroute;
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
54  friend class GNEChange_RerouterItem;
55  friend class GNEAdditionalHandler;
56 
57 public:
59  GNERerouterInterval(GNERerouterDialog* rerouterDialog);
60 
62  GNERerouterInterval(GNERerouter* rerouterParent, double begin, double end);
63 
66 
68  void writeRerouterInterval(OutputDevice& device) const;
69 
72 
74  double getBegin() const;
75 
77  double getEnd() const;
78 
81  /* @brief method for getting the Attribute of an XML key
82  * @param[in] key The attribute key
83  * @return string with the value associated to key
84  */
85  std::string getAttribute(SumoXMLAttr key) const;
86 
87  /* @brief method for setting the attribute and letting the object perform additional changes
88  * @param[in] key The attribute key
89  * @param[in] value The new value
90  * @param[in] undoList The undoList on which to register changes
91  */
92  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
93 
94  /* @brief method for checking if the key and their correspond attribute are valids
95  * @param[in] key The attribute key
96  * @param[in] value The value asociated to key key
97  * @return true if the value is valid, false in other case
98  */
99  bool isValid(SumoXMLAttr key, const std::string& value);
101 
103  const std::vector<GNEClosingLaneReroute*>& getClosingLaneReroutes() const;
104 
106  const std::vector<GNEClosingReroute*>& getClosingReroutes() const;
107 
109  const std::vector<GNEDestProbReroute*>& getDestProbReroutes() const;
110 
112  const std::vector<GNERouteProbReroute*>& getRouteProbReroutes() const;
113 
114 protected:
117 
119  double myBegin;
120 
122  double myEnd;
123 
125  std::vector<GNEClosingLaneReroute*> myClosingLaneReroutes;
126 
128  std::vector<GNEClosingReroute*> myClosingReroutes;
129 
131  std::vector<GNEDestProbReroute*> myDestProbReroutes;
132 
134  std::vector<GNERouteProbReroute*> myRouteProbReroutes;
135 
137  void addClosingLaneReroute(GNEClosingLaneReroute* closingLaneReroute);
138 
140  void removeClosingLaneReroute(GNEClosingLaneReroute* closingLaneReroute);
141 
143  void addClosingReroute(GNEClosingReroute* closingReroute);
144 
146  void removeClosingReroute(GNEClosingReroute* closingReroute);
147 
149  void addDestProbReroute(GNEDestProbReroute* destProbReroute);
150 
152  void removeDestProbReroute(GNEDestProbReroute* destProbReroute);
153 
155  void addRouteProbReroute(GNERouteProbReroute* routeProbabilityReroute);
156 
158  void removeRouteProbReroute(GNERouteProbReroute* routeProbabilityReroute);
159 
160 private:
162  void setAttribute(SumoXMLAttr key, const std::string& value);
163 
166 
169 };
170 
171 #endif
172 
173 /****************************************************************************/
const std::vector< GNEDestProbReroute * > & getDestProbReroutes() const
get destiny probability reroutes
const std::vector< GNEClosingLaneReroute * > & getClosingLaneReroutes() const
get closing reroutes
std::vector< GNEClosingReroute * > myClosingReroutes
vector with the closingReroutes
GNERerouterInterval(GNERerouterDialog *rerouterDialog)
constructor (Used in GNERerouterDialog)
void addDestProbReroute(GNEDestProbReroute *destProbReroute)
add destiny probability reroute
double getBegin() const
get begin
std::vector< GNEDestProbReroute * > myDestProbReroutes
vector with the destProbReroutes
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::vector< GNERouteProbReroute * > & getRouteProbReroutes() const
get reoute probability reroutes
void removeDestProbReroute(GNEDestProbReroute *destProbReroute)
add destiny probability reroute
void addClosingReroute(GNEClosingReroute *closingReroute)
add closing reroute
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
void writeRerouterInterval(OutputDevice &device) const
write Interval and all of their values
Dialog for edit rerouters.
void removeClosingReroute(GNEClosingReroute *closingReroute)
add closing reroute
double myBegin
begin timeStep
GNERerouter * getRerouterParent() const
get rerouter parent
void removeClosingLaneReroute(GNEClosingLaneReroute *closingLaneReroute)
add closing reroute
double myEnd
end timeStep
void addRouteProbReroute(GNERouteProbReroute *routeProbabilityReroute)
add reoute probability reroute
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
GNERerouter * myRerouterParent
pointer to rerouter parent
const std::vector< GNEClosingReroute * > & getClosingReroutes() const
get closing reroutes
GNERerouterInterval & operator=(GNERerouterInterval *)=delete
Invalidated assignment operator.
bool isValid(SumoXMLAttr key, const std::string &value)
std::vector< GNEClosingLaneReroute * > myClosingLaneReroutes
vector with the closingLaneReroutes
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)
double getEnd() const
get end
void addClosingLaneReroute(GNEClosingLaneReroute *closingLaneReroute)
add closing reroute
std::vector< GNERouteProbReroute * > myRouteProbReroutes
vector with the routeProbReroutes
~GNERerouterInterval()
destructor
void removeRouteProbReroute(GNERouteProbReroute *routeProbabilityReroute)
add reoute probability reroute