38 #include <xercesc/parsers/SAXParser.hpp>
39 #include <xercesc/util/PlatformUtils.hpp>
40 #include <xercesc/util/TransService.hpp>
41 #include <xercesc/sax2/SAX2XMLReader.hpp>
59 #ifdef HAVE_INTERNAL // catchall for internal stuff
60 #include <internal/RouteAggregator.h>
61 #endif // have HAVE_INTERNAL
63 #ifdef CHECK_MEMORY_LEAKS
65 #endif // CHECK_MEMORY_LEAKS
83 WRITE_WARNING(
"Trying to set a weight for the unknown edge '" +
id +
"'.");
85 WRITE_ERROR(
"Trying to set a weight for the unknown edge '" +
id +
"'.");
98 ROEdge* e = myNet.getEdge(
id);
104 WRITE_WARNING(
"Trying to set a weight for the unknown edge '" +
id +
"'.");
106 WRITE_ERROR(
"Trying to set a weight for the unknown edge '" +
id +
"'.");
132 throw ProcessError(
"Missing definition of network to load!");
135 throw ProcessError(
"The network file '" + file +
"' could not be found.");
149 throw ProcessError(
"The districts file '" + file +
"' could not be found.");
181 for (RouteLoaderCont::iterator i =
myHandler.begin(); ok && i !=
myHandler.end(); i++) {
201 bool endReached =
false;
202 bool errorOccured =
false;
206 for (; time < end && !errorOccured && !endReached; time +=
DELTA_T) {
212 for (RouteLoaderCont::iterator i =
myHandler.begin(); endReached && i !=
myHandler.end(); i++) {
213 if (!(*i)->ended()) {
227 RouteLoaderCont::iterator i;
232 if ((*i)->readRoutesAtLeastUntil(end)) {
248 RouteLoaderCont::const_iterator i =
myHandler.begin();
249 SUMOTime ret = (*i)->getLastReadTimeStep();
252 SUMOTime akt = (*i)->getLastReadTimeStep();
264 long absNo = end - start;
266 for (RouteLoaderCont::iterator i =
myHandler.begin(); ok && i !=
myHandler.end(); i++) {
271 for (; time < end;) {
281 #ifdef HAVE_INTERNAL // catchall for internal stuff
286 for (RouteLoaderCont::iterator i =
myHandler.begin(); ok && i !=
myHandler.end(); i++) {
289 RouteAggregator::processAllRoutes(net, router);
310 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
316 std::string msg =
"The loader for " + optionName +
" from file '" + *fileIt +
"' could not be initialised;";
317 std::string reason = e.what();
318 if (reason !=
"Process Error" && reason !=
"") {
319 msg = msg +
"\n Reason: " + reason +
".";
321 msg = msg +
"\n (unknown reason).";
333 const std::string& file,
335 if (optionName ==
"route-files" || optionName ==
"alternative-files") {
340 if (optionName ==
"trip-files") {
345 if (optionName ==
"flow-files") {
356 const std::string& measure,
bool useLanes) {
362 std::vector<SAXWeightsHandler::ToRetrieveDefinition*> retrieverDefs;
368 if (measure !=
"traveltime") {
369 std::string umeasure = measure;
370 if (measure ==
"CO" || measure ==
"CO2" || measure ==
"HC" || measure ==
"PMx" || measure ==
"NOx" || measure ==
"fuel") {
371 umeasure = measure +
"_perVeh";
379 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
389 const std::map<std::string, ROEdge*>& edges = net.
getEdgeMap();
390 for (std::map<std::string, ROEdge*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
391 (*i).second->buildTimeLines(measure);
408 for (RouteLoaderCont::const_iterator i =
myHandler.begin(); i !=
myHandler.end(); ++i) {