37 #include <xercesc/sax/SAXException.hpp>
38 #include <xercesc/sax/SAXParseException.hpp>
65 #ifdef HAVE_INTERNAL // catchall for internal stuff
66 #include <internal/BulkStarRouter.h>
67 #include <internal/CHRouter.h>
68 #include <internal/CHRouterWrapper.h>
69 #endif // have HAVE_INTERNAL
71 #ifdef CHECK_MEMORY_LEAKS
73 #endif // CHECK_MEMORY_LEAKS
93 if (oc.
isSet(
"weight-files")) {
96 if (oc.
isSet(
"lane-weight-files")) {
111 const std::string& filename = oc.
getString(
"output-file");
112 std::string altFilename = filename +
".alt";
113 const size_t len = filename.length();
114 if (len > 4 && filename.substr(len - 4) ==
".xml") {
115 altFilename = filename.substr(0, len - 4) +
".alt.xml";
116 }
else if (len > 4 && filename.substr(len - 4) ==
".sbx") {
117 altFilename = filename.substr(0, len - 4) +
".alt.sbx";
121 const std::string measure = oc.
getString(
"weight-attribute");
122 const std::string routingAlgorithm = oc.
getString(
"routing-algorithm");
123 if (measure ==
"traveltime") {
124 if (routingAlgorithm ==
"dijkstra") {
132 }
else if (routingAlgorithm ==
"astar") {
140 #ifdef HAVE_INTERNAL // catchall for internal stuff
141 }
else if (routingAlgorithm ==
"bulkstar") {
143 router =
new BulkStarRouterTT<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
146 router =
new BulkStarRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
150 }
else if (routingAlgorithm ==
"CH") {
159 router =
new CHRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
162 router =
new CHRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
166 }
else if (routingAlgorithm ==
"CHWrapper") {
172 router =
new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
175 #endif // have HAVE_INTERNAL
177 throw ProcessError(
"Unknown routing Algorithm '" + routingAlgorithm +
"'!");
182 if (measure ==
"CO") {
184 }
else if (measure ==
"CO2") {
186 }
else if (measure ==
"PMx") {
188 }
else if (measure ==
"HC") {
190 }
else if (measure ==
"NOx") {
192 }
else if (measure ==
"fuel") {
194 }
else if (measure ==
"noise") {
198 throw ProcessError(
"Unknown measure (weight attribute '" + measure +
"')!");
211 if (routingAlgorithm ==
"bulkstar") {
212 #ifdef HAVE_INTERNAL // catchall for internal stuff
264 }
catch (XERCES_CPP_NAMESPACE::SAXParseException& e) {
267 }
catch (XERCES_CPP_NAMESPACE::SAXException& e) {
275 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
281 }
catch (
const std::exception& e) {
282 if (std::string(e.what()) != std::string(
"")) {
295 std::cout <<
"Success." << std::endl;