diff --git a/.gitignore b/.gitignore index 3986f7a..0545382 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,7 @@ vignettes/*.pdf # compilation files *.o + +# Visual Studio +.vs/ +out/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6700d5d..31e59e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,4 +4,8 @@ add_library(RScore Species.cpp Cell.cpp Community.cpp FractalGenerator.cpp Genome.cpp Individual.cpp Landscape.cpp Model.cpp Parameters.cpp Patch.cpp Population.cpp RandomCheck.cpp RSrandom.cpp SubCommunity.cpp) # pass config definitions to compiler -target_compile_definitions(RScore PRIVATE "RSDEBUG" "LINUX_CLUSTER" "RSWIN64" "BATCH") \ No newline at end of file +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_compile_definitions(RScore PRIVATE "RSDEBUG" "RSWIN64" "LINUX_CLUSTER") +else() # Windows + target_compile_definitions(RScore PRIVATE "RSDEBUG" "RSWIN64") +endif() \ No newline at end of file diff --git a/Model.cpp b/Model.cpp index 9f26886..64b5d87 100644 --- a/Model.cpp +++ b/Model.cpp @@ -152,17 +152,10 @@ DEBUGLOG << endl << "RunModel(): generating new landscape ..." << endl; DEBUGLOG << "RunModel(): finished resetting landscape" << endl << endl; #endif pLandscape->generatePatches(); -//#if VCL if (v.viewLand || sim.saveMaps) { pLandscape->setLandMap(); pLandscape->drawLandscape(rep,0,ppLand.landNum); } -//#endif -//#if BATCH -// if (sim.saveMaps) { -// pLandscape->drawLandscape(rep,0,ppLand.landNum); -// } -//#endif #if RSDEBUG DEBUGLOG << endl << "RunModel(): finished generating patches" << endl; #endif @@ -313,12 +306,8 @@ DEBUGLOG << "RunModel(): completed updating carrying capacity" << endl; DEBUGLOG << "RunModel(): completed initialisation, rep=" << rep << " pSpecies=" << pSpecies << endl; #endif -#if BATCH -#if RS_RCPP && !R_CMD +#if BATCH && RS_RCPP && !R_CMD Rcpp::Rcout << "RunModel(): completed initialisation " << endl; -#else - cout << "RunModel(): completed initialisation " << endl; -#endif #endif // open a new individuals file for each replicate @@ -926,7 +915,7 @@ return errorfolder; //For outputs and population visualisations pre-reproduction void PreReproductionOutput(Landscape *pLand,Community *pComm,int rep,int yr,int gen) { -#if RSDEBUG || VCL +#if RSDEBUG landParams ppLand = pLand->getLandParams(); #endif simParams sim = paramsSim->getSim(); @@ -1341,22 +1330,6 @@ if (dem.stageStruct){ outPar << endl; } } -#if VCL - else { - - // NOTE: TO PREVENT COMPILING FOR BATCH MODE, THIS CODE NEEDS TO BE INCLUDED IN COMPILER - // CONDITIONAL BLOCK AS SHOWN - -// outPar << "Row count: " << frmSpecies->transMatrix->RowCount << endl; -// outPar << "Col count: " << frmSpecies->transMatrix->ColCount << endl; - for (int i = 1; i < frmSpecies->transMatrix->RowCount; i++) { - for (int j = 1; j < frmSpecies->transMatrix->ColCount; j++) { - outPar << frmSpecies->transMatrix->Cells[j][i].ToDouble() << "\t"; - } - outPar << endl; - } - } -#endif outPar << endl; #endif */ diff --git a/Model.h b/Model.h index dc943fd..5bd02bd 100644 --- a/Model.h +++ b/Model.h @@ -75,12 +75,12 @@ extern ofstream DEBUGLOG; #if RS_RCPP && !R_CMD Rcpp::List RunModel( Landscape*, // pointer to Landscape - int // sequential simulation number (always 0 for VCL version) + int // sequential simulation number ); #else int RunModel( Landscape*, // pointer to Landscape - int // sequential simulation number (always 0 for VCL version) + int // sequential simulation number ); #endif // RS_RCPP && !R_CMD bool CheckDirectory(void); @@ -125,11 +125,11 @@ extern Community *pComm; const bool batchMode = true; extern string landFile; extern vector hfnames; -extern string habmapname; // see FormLand.cpp (VCL) OR Main.cpp (batch) -extern string patchmapname; // see FormLand.cpp (VCL) OR Main.cpp (batch) -extern string distnmapname; // see FormLand.cpp (VCL) OR Main.cpp (batch) -extern string costmapname; // see FormMove.cpp (VCL) OR Main.cpp (batch) -extern string genfilename; // see FormGenetics.cpp (VCL) OR Main.cpp (batch) +extern string habmapname; // see Main.cpp (batch) +extern string patchmapname; // see Main.cpp (batch) +extern string distnmapname; // see Main.cpp (batch) +extern string costmapname; // see Main.cpp (batch) +extern string genfilename; // see Main.cpp (batch) extern RSrandom *pRandom; // these functions to have different version for GUI and batch applications ... diff --git a/Population.cpp b/Population.cpp index 05d8633..002e860 100644 --- a/Population.cpp +++ b/Population.cpp @@ -433,12 +433,6 @@ void Population::reproduction(const float localK,const float envval,const int re int ninds = (int)inds.size(); #if RSDEBUG //DEBUGLOG << "Population::reproduction(): this=" << this -//#if BUTTERFLYDISP -// << " option=" << option -//#endif // BUTTERFLYDISP -//#if RS_CONTAIN -// << " hab=" << hab -//#endif // RS_CONTAIN // << " ninds=" << ninds // << endl; #endif // RSDEBUG @@ -464,12 +458,8 @@ if (dem.repType == 0) nsexes = 1; else nsexes = 2; #if RSDEBUG //DEBUGLOG << "Population::reproduction(): this=" << this -//#if RS_CONTAIN -// << " hab=" << hab -//#else // << " pSpecies=" << pSpecies // << " localK=" << localK << " envval=" << envval << " resol=" << resol -//#endif // RS_CONTAIN // << " sstruct.nStages=" << sstruct.nStages << " nsexes=" << nsexes << " ninds=" << ninds // << endl; #endif