46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
83 throw ProcessError(
"Could not access network file '" + districtfile +
"' to load.");
98 for (std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >::const_iterator it = districts.begin(); it != districts.end(); ++it) {
100 const std::vector<std::string>& sources = it->second.first;
101 for (std::vector<std::string>::const_iterator i = sources.begin(); i != sources.end(); ++i) {
104 const std::vector<std::string>& sinks = it->second.second;
105 for (std::vector<std::string>::const_iterator i = sinks.begin(); i != sinks.end(); ++i) {
std::string getRandomSource() const
Returns the id of a source to use.
static bool isReadable(std::string path)
Checks whether the given file is readable.
virtual bool add(const std::string &id, ODDistrict *item)
Adds an item.
void makeDistricts(const std::map< std::string, std::pair< std::vector< std::string >, std::vector< std::string > > > &districts)
create districts from description
void addSink(const std::string &id, SUMOReal weight)
Adds a sink connection.
An XML-Handler for districts.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
void loadDistricts(std::string districtfile)
load districts from FILE
#define PROGRESS_FAILED_MESSAGE()
const std::string & getID() const
Returns the id.
~ODDistrictCont()
Destructor.
void addSource(const std::string &id, SUMOReal weight)
Adds a source connection.
std::string getRandomSourceFromDistrict(const std::string &name) const
Returns the id of a random source from the named district.
ODDistrictCont()
Constructor.
std::string getRandomSink() const
Returns the id of a sink to use.
#define PROGRESS_BEGIN_MESSAGE(msg)
std::string getRandomSinkFromDistrict(const std::string &name) const
Returns the id of a random sink from the named district.
#define PROGRESS_DONE_MESSAGE()
A district (origin/destination)