SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODDistrict.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // A district (origin/destination)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
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>
37 #include <utils/common/Named.h>
39 #include "ODDistrict.h"
40 
41 
42 #ifdef CHECK_MEMORY_LEAKS
43 #include <foreign/nvwa/debug_new.h>
44 #endif // CHECK_MEMORY_LEAKS
45 
46 
47 // ===========================================================================
48 // method definitions
49 // ===========================================================================
50 ODDistrict::ODDistrict(const std::string& id)
51  : Named(id) {}
52 
53 
55 
56 
57 void
58 ODDistrict::addSource(const std::string& id, SUMOReal weight) {
59  mySources.add(weight, id);
60 }
61 
62 
63 void
64 ODDistrict::addSink(const std::string& id, SUMOReal weight) {
65  mySinks.add(weight, id);
66 }
67 
68 
69 std::string
71  return mySources.get();
72 }
73 
74 
75 std::string
77  return mySinks.get();
78 }
79 
80 
81 unsigned int
83  return (unsigned int) mySinks.getVals().size();
84 }
85 
86 
87 unsigned int
89  return (unsigned int) mySources.getVals().size();
90 }
91 
92 
93 
94 /****************************************************************************/
95