SUMO - Simulation of Urban MObility
ODDistrict.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-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 /****************************************************************************/
18 // A district (origin/destination)
19 /****************************************************************************/
20 #ifndef ODDistrict_h
21 #define ODDistrict_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 <vector>
34 #include <string>
35 #include <utility>
36 #include <utils/common/Named.h>
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
51 class ODDistrict : public Named {
52 public:
57  ODDistrict(const std::string& id);
58 
59 
61  ~ODDistrict();
62 
63 
77  void addSource(const std::string& id, double weight);
78 
79 
93  void addSink(const std::string& id, double weight);
94 
95 
104  std::string getRandomSource() const;
105 
106 
115  std::string getRandomSink() const;
116 
117 
122  int sinkNumber() const;
123 
124 
129  int sourceNumber() const;
130 
131 
132 private:
135 
138 
139 
140 private:
142  ODDistrict(const ODDistrict& s);
143 
145  ODDistrict& operator=(const ODDistrict& s);
146 
147 
148 };
149 
150 
151 #endif
152 
153 /****************************************************************************/
154 
std::string getRandomSource() const
Returns the id of a source to use.
Definition: ODDistrict.cpp:65
std::string getRandomSink() const
Returns the id of a sink to use.
Definition: ODDistrict.cpp:71
void addSink(const std::string &id, double weight)
Adds a sink connection.
Definition: ODDistrict.cpp:59
~ODDistrict()
Destructor.
Definition: ODDistrict.cpp:49
int sourceNumber() const
Returns the number of sources.
Definition: ODDistrict.cpp:83
ODDistrict(const std::string &id)
Constructor.
Definition: ODDistrict.cpp:45
RandomDistributor< std::string > mySinks
Container of weighted sinks.
Definition: ODDistrict.h:137
RandomDistributor< std::string > mySources
Container of weighted sources.
Definition: ODDistrict.h:134
Base class for objects which have an id.
Definition: Named.h:54
ODDistrict & operator=(const ODDistrict &s)
invalidated assignment operator
A district (origin/destination)
Definition: ODDistrict.h:51
void addSource(const std::string &id, double weight)
Adds a source connection.
Definition: ODDistrict.cpp:53
int sinkNumber() const
Returns the number of sinks.
Definition: ODDistrict.cpp:77