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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A district (origin/destination)
17 /****************************************************************************/
18 #ifndef ODDistrict_h
19 #define ODDistrict_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
28 #include <string>
29 #include <utility>
30 #include <utils/common/Named.h>
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
45 class ODDistrict : public Named {
46 public:
51  ODDistrict(const std::string& id);
52 
53 
55  ~ODDistrict();
56 
57 
71  void addSource(const std::string& id, double weight);
72 
73 
87  void addSink(const std::string& id, double weight);
88 
89 
98  std::string getRandomSource() const;
99 
100 
109  std::string getRandomSink() const;
110 
111 
116  int sinkNumber() const;
117 
118 
123  int sourceNumber() const;
124 
125 
126 private:
129 
132 
133 
134 private:
136  ODDistrict(const ODDistrict& s);
137 
139  ODDistrict& operator=(const ODDistrict& s);
140 
141 
142 };
143 
144 
145 #endif
146 
147 /****************************************************************************/
148 
std::string getRandomSource() const
Returns the id of a source to use.
Definition: ODDistrict.cpp:59
std::string getRandomSink() const
Returns the id of a sink to use.
Definition: ODDistrict.cpp:65
void addSink(const std::string &id, double weight)
Adds a sink connection.
Definition: ODDistrict.cpp:53
~ODDistrict()
Destructor.
Definition: ODDistrict.cpp:43
int sourceNumber() const
Returns the number of sources.
Definition: ODDistrict.cpp:77
ODDistrict(const std::string &id)
Constructor.
Definition: ODDistrict.cpp:39
RandomDistributor< std::string > mySinks
Container of weighted sinks.
Definition: ODDistrict.h:131
RandomDistributor< std::string > mySources
Container of weighted sources.
Definition: ODDistrict.h:128
Base class for objects which have an id.
Definition: Named.h:58
ODDistrict & operator=(const ODDistrict &s)
invalidated assignment operator
A district (origin/destination)
Definition: ODDistrict.h:45
void addSource(const std::string &id, double weight)
Adds a source connection.
Definition: ODDistrict.cpp:47
int sinkNumber() const
Returns the number of sinks.
Definition: ODDistrict.cpp:71