50 if (district ==
nullptr) {
60 if (district ==
nullptr) {
69 for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) {
70 const std::string& districtfile = *i;
72 throw ProcessError(
TLF(
"Could not access network file '%' to load.", districtfile));
88 for (std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >::const_iterator it = districts.begin(); it != districts.end(); ++it) {
90 const std::vector<std::string>& sources = it->second.first;
91 for (std::vector<std::string>::const_iterator i = sources.begin(); i != sources.end(); ++i) {
94 const std::vector<std::string>& sinks = it->second.second;
95 for (std::vector<std::string>::const_iterator i = sinks.begin(); i != sinks.end(); ++i) {
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_FAILED_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
static bool isReadable(std::string path)
Checks whether the given file is readable.
const std::string & getID() const
Returns the id.
ODDistrict * get(const std::string &id) const
Retrieves an item.
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
std::string getRandomSourceFromDistrict(const std::string &name) const
Returns the id of a random source from the named district.
std::string getRandomSinkFromDistrict(const std::string &name) const
Returns the id of a random sink from the named district.
~ODDistrictCont()
Destructor.
void loadDistricts(std::vector< std::string > files)
load districts from files
ODDistrictCont()
Constructor.
An XML-Handler for districts.
A district (origin/destination)
void addSource(const std::string &id, double weight)
Adds a source connection.
void addSink(const std::string &id, double weight)
Adds a sink connection.
std::string getRandomSink() const
Returns the id of a sink to use.
std::string getRandomSource() const
Returns the id of a source to use.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.