SUMO - Simulation of Urban MObility
ODDistrict.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A district (origin/destination)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef ODDistrict_h
22 #define ODDistrict_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <string>
36 #include <utility>
37 #include <utils/common/Named.h>
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
52 class ODDistrict : public Named {
53 public:
58  ODDistrict(const std::string& id);
59 
60 
62  ~ODDistrict();
63 
64 
78  void addSource(const std::string& id, SUMOReal weight);
79 
80 
94  void addSink(const std::string& id, SUMOReal weight);
95 
96 
105  std::string getRandomSource() const;
106 
107 
116  std::string getRandomSink() const;
117 
118 
123  unsigned int sinkNumber() const;
124 
125 
130  unsigned int sourceNumber() const;
131 
132 
133 private:
136 
139 
140 
141 private:
143  ODDistrict(const ODDistrict& s);
144 
146  ODDistrict& operator=(const ODDistrict& s);
147 
148 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155 
std::string getRandomSource() const
Returns the id of a source to use.
Definition: ODDistrict.cpp:70
~ODDistrict()
Destructor.
Definition: ODDistrict.cpp:54
ODDistrict(const std::string &id)
Constructor.
Definition: ODDistrict.cpp:50
void addSink(const std::string &id, SUMOReal weight)
Adds a sink connection.
Definition: ODDistrict.cpp:64
unsigned int sinkNumber() const
Returns the number of sinks.
Definition: ODDistrict.cpp:82
RandomDistributor< std::string > mySinks
Container of weighted sinks.
Definition: ODDistrict.h:138
void addSource(const std::string &id, SUMOReal weight)
Adds a source connection.
Definition: ODDistrict.cpp:58
RandomDistributor< std::string > mySources
Container of weighted sources.
Definition: ODDistrict.h:135
std::string getRandomSink() const
Returns the id of a sink to use.
Definition: ODDistrict.cpp:76
unsigned int sourceNumber() const
Returns the number of sources.
Definition: ODDistrict.cpp:88
Base class for objects which have an id.
Definition: Named.h:45
#define SUMOReal
Definition: config.h:213
ODDistrict & operator=(const ODDistrict &s)
invalidated assignment operator
A district (origin/destination)
Definition: ODDistrict.h:52