SUMO - Simulation of Urban MObility
GNECalibratorFlow.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 // Flow used by GNECalibrators
18 /****************************************************************************/
19 #ifndef GNECalibratorFlow_h
20 #define GNECalibratorFlow_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 
34 #include <utils/common/RGBColor.h>
35 
36 #include "GNEAttributeCarrier.h"
37 
38 // ===========================================================================
39 // class declaration
40 // ===========================================================================
41 
42 class GNECalibrator;
45 class GNECalibratorRoute;
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
55 
56 public:
57 
59  enum TypeOfFlow {
64  };
65 
67  GNECalibratorFlow(GNECalibratorDialog* calibratorDialog);
68 
70  GNECalibratorFlow(GNECalibrator* calibratorParent, const std::string& flowID, GNECalibratorVehicleType* vehicleType, GNECalibratorRoute* route,
71  const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane,
72  const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute,
73  const std::string& departPosLat, const std::string& arrivalPosLat, double begin, double end, double vehsPerHour, double period,
74  double probability, int number, GNECalibratorFlow::TypeOfFlow flowType);
75 
78 
80  void writeFlow(OutputDevice& device);
81 
84 
87 
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  * @param[in] net optionally the GNENet to inform about gui updates
104  */
105  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
106 
107  /* @brief method for setting the attribute and letting the object perform additional changes
108  * @param[in] key The attribute key
109  * @param[in] value The new value
110  * @param[in] undoList The undoList on which to register changes
111  */
112  bool isValid(SumoXMLAttr key, const std::string& value);
114 
115 protected:
118 
120  std::string myFlowID;
121 
124 
127 
130 
132  std::string myDepartLane;
133 
135  std::string myDepartPos;
136 
138  std::string myDepartSpeed;
139 
141  std::string myArrivalLane;
142 
144  std::string myArrivalPos;
145 
147  std::string myArrivalSpeed;
148 
150  std::string myLine;
151 
154 
157 
159  bool myReroute;
160 
162  std::string myDepartPosLat;
163 
165  std::string myArrivalPosLat;
166 
170  double myBegin;
171 
173  double myEnd;
174 
177 
179  double myPeriod;
180 
183 
185  int myNumber;
187 
190 
191 private:
193  void setAttribute(SumoXMLAttr key, const std::string& value);
194 
196  GNECalibratorFlow(const GNECalibratorFlow&) = delete;
197 
200 };
201 
202 #endif
203 /****************************************************************************/
RGBColor myColor
color of flow
~GNECalibratorFlow()
destructor
bool isValid(SumoXMLAttr key, const std::string &value)
std::string myLine
line of bus/container stop
std::string myDepartPosLat
departPosLat
void setFlowType(GNECalibratorFlow::TypeOfFlow type)
set type of flow
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double myPeriod
period
int myNumber
number of flow
bool myReroute
reroute
GNECalibratorFlow(GNECalibratorDialog *calibratorDialog)
constructor (used only in GNECalibratorDialog)
std::string myArrivalPos
arrival pos
double myEnd
time step end
std::string myArrivalPosLat
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
int myPersonNumber
number of person
std::string myDepartPos
depart position
GNECalibratorFlow & operator=(const GNECalibratorFlow &)=delete
Invalidated assignment operator.
TypeOfFlow
type of flow
std::string myDepartLane
depart lane
std::string myArrivalLane
arrival lane
double myVehsPerHour
flows per hour
std::string myFlowID
ID of flow.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
int myContainerNumber
number of container
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
Dialog for edit calibrators.
double myProbability
probability
GNECalibrator * myCalibratorParent
pointer to calibrator parent
std::string myArrivalSpeed
arrival speed
std::string myDepartSpeed
depart speed
TypeOfFlow myFlowType
type of flow
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
GNECalibratorFlow::TypeOfFlow getFlowType() const
get type of flow
GNECalibratorVehicleType * myVehicleType
type of flow
void writeFlow(OutputDevice &device)
write Flow values into a XML
GNECalibratorRoute * myRoute
route in which this flow is used