SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODDistrict.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A district (origin/destination)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
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, SUMOReal weight);
78 
79 
93  void addSink(const std::string& id, SUMOReal weight);
94 
95 
104  std::string getRandomSource() const;
105 
106 
115  std::string getRandomSink() const;
116 
117 
122  unsigned int sinkNumber() const;
123 
124 
129  unsigned 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:69
Represents a generic random distribution.
~ODDistrict()
Destructor.
Definition: ODDistrict.cpp:53
ODDistrict(const std::string &id)
Constructor.
Definition: ODDistrict.cpp:49
void addSink(const std::string &id, SUMOReal weight)
Adds a sink connection.
Definition: ODDistrict.cpp:63
unsigned int sinkNumber() const
Returns the number of sinks.
Definition: ODDistrict.cpp:81
RandomDistributor< std::string > mySinks
Container of weighted sinks.
Definition: ODDistrict.h:137
void addSource(const std::string &id, SUMOReal weight)
Adds a source connection.
Definition: ODDistrict.cpp:57
RandomDistributor< std::string > mySources
Container of weighted sources.
Definition: ODDistrict.h:134
std::string getRandomSink() const
Returns the id of a sink to use.
Definition: ODDistrict.cpp:75
unsigned int sourceNumber() const
Returns the number of sources.
Definition: ODDistrict.cpp:87
Base class for objects which have an id.
Definition: Named.h:45
#define SUMOReal
Definition: config.h:215
ODDistrict & operator=(const ODDistrict &s)
invalidated assignment operator
A district (origin/destination)
Definition: ODDistrict.h:51