Skip to content

Commit

Permalink
strip unused macros
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoPannetier committed Nov 9, 2023
1 parent 233898d commit 3764f7a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 47 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ vignettes/*.pdf

# compilation files
*.o

# Visual Studio
.vs/
out/
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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()
31 changes: 2 additions & 29 deletions Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
*/
Expand Down
14 changes: 7 additions & 7 deletions Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -125,11 +125,11 @@ extern Community *pComm;
const bool batchMode = true;
extern string landFile;
extern vector <string> 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 ...
Expand Down
10 changes: 0 additions & 10 deletions Population.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3764f7a

Please sign in to comment.