Eclipse 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-2019 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 /****************************************************************************/
15 // A district (origin/destination)
16 /****************************************************************************/
17 #ifndef ODDistrict_h
18 #define ODDistrict_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <vector>
27 #include <string>
28 #include <utility>
29 #include <utils/common/Named.h>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
44 class ODDistrict : public Named {
45 public:
50  ODDistrict(const std::string& id);
51 
52 
54  ~ODDistrict();
55 
56 
70  void addSource(const std::string& id, double weight);
71 
72 
86  void addSink(const std::string& id, double weight);
87 
88 
97  std::string getRandomSource() const;
98 
99 
108  std::string getRandomSink() const;
109 
110 
115  int sinkNumber() const;
116 
117 
122  int sourceNumber() const;
123 
124 
125 private:
128 
131 
132 
133 private:
135  ODDistrict(const ODDistrict& s);
136 
138  ODDistrict& operator=(const ODDistrict& s);
139 
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
ODDistrict::operator=
ODDistrict & operator=(const ODDistrict &s)
invalidated assignment operator
Named
Base class for objects which have an id.
Definition: Named.h:56
ODDistrict::~ODDistrict
~ODDistrict()
Destructor.
Definition: ODDistrict.cpp:42
ODDistrict::mySources
RandomDistributor< std::string > mySources
Container of weighted sources.
Definition: ODDistrict.h:127
ODDistrict::sinkNumber
int sinkNumber() const
Returns the number of sinks.
Definition: ODDistrict.cpp:70
ODDistrict::addSink
void addSink(const std::string &id, double weight)
Adds a sink connection.
Definition: ODDistrict.cpp:52
RandomDistributor.h
ODDistrict
A district (origin/destination)
Definition: ODDistrict.h:44
Named.h
ODDistrict::addSource
void addSource(const std::string &id, double weight)
Adds a source connection.
Definition: ODDistrict.cpp:46
UtilExceptions.h
ODDistrict::sourceNumber
int sourceNumber() const
Returns the number of sources.
Definition: ODDistrict.cpp:76
RandomDistributor< std::string >
ODDistrict::mySinks
RandomDistributor< std::string > mySinks
Container of weighted sinks.
Definition: ODDistrict.h:130
ODDistrict::getRandomSink
std::string getRandomSink() const
Returns the id of a sink to use.
Definition: ODDistrict.cpp:64
ODDistrict::ODDistrict
ODDistrict(const std::string &id)
Constructor.
Definition: ODDistrict.cpp:38
config.h
ODDistrict::getRandomSource
std::string getRandomSource() const
Returns the id of a source to use.
Definition: ODDistrict.cpp:58