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";
122 const std::string measure = oc.
getString(
"weight-attribute");
123 const std::string routingAlgorithm = oc.
getString(
"routing-algorithm");
124 if (measure ==
"traveltime") {
125 if (routingAlgorithm ==
"dijkstra") {
133 }
else if (routingAlgorithm ==
"astar") {
141 #ifdef HAVE_INTERNAL // catchall for internal stuff
142 }
else if (routingAlgorithm ==
"bulkstar") {
144 router =
new BulkStarRouterTT<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
147 router =
new BulkStarRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
151 }
else if (routingAlgorithm ==
"CH") {
160 router =
new CHRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
163 router =
new CHRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
167 }
else if (routingAlgorithm ==
"CHWrapper") {
173 router =
new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
176 #endif // have HAVE_INTERNAL
178 throw ProcessError(
"Unknown routing Algorithm '" + routingAlgorithm +
"'!");
183 if (measure ==
"CO") {
185 }
else if (measure ==
"CO2") {
187 }
else if (measure ==
"PMx") {
189 }
else if (measure ==
"HC") {
191 }
else if (measure ==
"NOx") {
193 }
else if (measure ==
"fuel") {
195 }
else if (measure ==
"noise") {
199 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;