Skip to content

Commit 1eb7b97

Browse files
Added new options.
1 parent 8b1d02f commit 1eb7b97

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

defines.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,4 @@ namespace marxan {
9191

9292
extern sfname fnames;
9393

94-
//extern srunoptions runoptions;
95-
9694
}

input.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,18 @@ namespace marxan {
945945
readInputOption(fileLines, "RBINARYPATHNAME", fnames.rbinarypath, 0, present);
946946

947947
/* various other controls */
948-
int runmode;
948+
int runmode = -1;
949949
readInputOption(fileLines, "RUNMODE", runmode, 0, present);
950-
if(present)
951-
{
952-
runoptions.setDefaultRunOptions(runmode);
953-
}
950+
951+
runoptions.setDefaultRunOptions(runmode);
952+
953+
//Read or replace individual run options
954+
readInputOption(fileLines, "CALCPENALTIES", runoptions.CalcPenaltiesOn, 0, present);
955+
readInputOption(fileLines, "THERMALANNEALING", runoptions.ThermalAnnealingOn, 0, present);
956+
readInputOption(fileLines, "HEURISTIC", runoptions.HeuristicOn, 0, present);
957+
readInputOption(fileLines, "HILLCLIMBING", runoptions.HillClimbingOn, 0, present);
958+
readInputOption(fileLines, "TWOSTEPHILLCLIMBING", runoptions.TwoStepHillClimbingOn, 0, present);
959+
readInputOption(fileLines, "ITERATIVEIMPROVEMENT", runoptions.ItImpOn, 0, present);
954960

955961
readInputOption(fileLines, "MISSLEVEL", misslevel, 0, present);
956962
readInputOption(fileLines, "HEURTYPE", heurotype, 0, present);

marxan.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ namespace marxan {
6262
vector<spustuff> pu;
6363
map<int, int> PULookup, SPLookup;
6464
vector<sspecies> specGlobal, bestSpec;
65-
srunoptions runoptions;
6665
chrono::high_resolution_clock::time_point startTime;
6766

6867
double rProbabilityWeighting = 1;
@@ -417,6 +416,7 @@ namespace marxan {
417416
long int itemp;
418417
int isp;
419418
int maxThreads = omp_get_max_threads();
419+
srunoptions runoptions;
420420

421421

422422
displayStartupMessage();

0 commit comments

Comments
 (0)