From 680d3e7d927733e4e13b7085dde0855df4c8581b Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sat, 6 Oct 2012 17:21:53 +0200 Subject: [PATCH 1/2] Implementing issue #422, also briefly discussed with @lonvia --- createHierarchy.cpp | 7 ++++--- extractor.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/createHierarchy.cpp b/createHierarchy.cpp index 0cf847198..9381ec329 100644 --- a/createHierarchy.cpp +++ b/createHierarchy.cpp @@ -69,7 +69,7 @@ std::vector trafficLightNodes; int main (int argc, char *argv[]) { if(argc < 3) { - ERR("usage: " << std::endl << argv[0] << " "); + ERR("usage: " << std::endl << argv[0] << " []"); } double startupTime = get_timestamp(); @@ -119,7 +119,7 @@ int main (int argc, char *argv[]) { ERR("The input data is broken. It is impossible to do any turns in this graph"); - if(!testDataFile("profile.lua")) { + if(!testDataFile( (argc > 4 ? argv[3] : "profile.lua") )) { ERR("Need profile.lua to apply traffic signal penalty"); } /*** Setup Scripting Environment ***/ @@ -132,7 +132,8 @@ int main (int argc, char *argv[]) { // Now call our function in a lua script - if(0 != luaL_dofile(myLuaState, "profile.lua")) { + INFO("Parsing speedprofile from " << (argc > 3 ? argv[3] : "profile.lua") ); + if(0 != luaL_dofile(myLuaState, (argc > 3 ? argv[3] : "profile.lua") )) { ERR(lua_tostring(myLuaState,-1)<< " occured in scripting block"); } diff --git a/extractor.cpp b/extractor.cpp index 940512070..31d59834d 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -52,7 +52,7 @@ bool wayFunction(_Way w); int main (int argc, char *argv[]) { if(argc < 2) { - ERR("usage: \n" << argv[0] << " "); + ERR("usage: \n" << argv[0] << " []"); } INFO("extracting data from input file " << argv[1]); @@ -142,7 +142,8 @@ int main (int argc, char *argv[]) { ] ]; // Now call our function in a lua script - if(0 != luaL_dofile(myLuaState, "profile.lua")) { + INFO("Parsing speedprofile from " << (argc > 2 ? argv[2] : "profile.lua") ); + if(0 != luaL_dofile(myLuaState, (argc > 2 ? argv[2] : "profile.lua") )) { ERR(lua_tostring(myLuaState,-1)<< " occured in scripting block"); } @@ -156,14 +157,15 @@ int main (int argc, char *argv[]) { if(installedRAM < 2048264) { WARN("Machine has less than 2GB RAM."); } - if(testDataFile("extractor.ini")) { +/* if(testDataFile("extractor.ini")) { ExtractorConfiguration extractorConfig("extractor.ini"); unsigned memoryAmountFromFile = atoi(extractorConfig.GetParameter("Memory").c_str()); if( memoryAmountFromFile != 0 && memoryAmountFromFile <= installedRAM/(1024*1024)) amountOfRAM = memoryAmountFromFile; INFO("Using " << amountOfRAM << " GB of RAM for buffers"); } - + */ + StringMap stringMap; ExtractionContainers externalMemory; From 6fe931fe4c6c83ba120a08d57ac9bdccf409628d Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sat, 6 Oct 2012 17:22:53 +0200 Subject: [PATCH 2/2] Implementing issue #422, also briefly discussed with @lonvia --- createHierarchy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/createHierarchy.cpp b/createHierarchy.cpp index 9381ec329..51778b1e5 100644 --- a/createHierarchy.cpp +++ b/createHierarchy.cpp @@ -119,7 +119,7 @@ int main (int argc, char *argv[]) { ERR("The input data is broken. It is impossible to do any turns in this graph"); - if(!testDataFile( (argc > 4 ? argv[3] : "profile.lua") )) { + if(!testDataFile( (argc > 3 ? argv[3] : "profile.lua") )) { ERR("Need profile.lua to apply traffic signal penalty"); } /*** Setup Scripting Environment ***/