Skip to content

Commit ee6dc61

Browse files
Matiasclaude
authored andcommitted
refactor: replace --no-prob-map with --prob-map (opt-in instead of opt-out)
Default is now uniform random ignition (ignProb = 1.0 everywhere). Pass --prob-map to activate probability-map-weighted ignition selection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7dd5bfd commit ee6dc61

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Cell2Fire/DataGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ populateInputsDirect(inputs* df_ptr, int nCells, std::vector<float>& ignProb, ar
10831083
df_ptr->FMC = std::isnan(FMC[i]) ? args_ptr->FMC : static_cast<int>(FMC[i]);
10841084

10851085
// ignition probability — stored in ignProb, not in inputs
1086-
ignProb[i] = (args_ptr->NoProbMap || std::isnan(PM[i])) ? 1.f : PM[i];
1086+
ignProb[i] = (args_ptr->UseProbMap && !std::isnan(PM[i])) ? PM[i] : 1.f;
10871087

10881088
// calendar / time (blank in Data.csv → 0 except time=20)
10891089
df_ptr->jd = 0;

Cell2Fire/ReadArgs.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,12 @@ parseArgs(int argc, char* argv[], arguments* args_ptr)
269269
printf("CrownROS: %s \n", btoa(allow_cros));
270270
}
271271

272-
//--no-prob-map
273-
bool no_prob_map = false;
274-
if (cmdOptionExists(argv, argv + argc, "--no-prob-map"))
272+
//--prob-map
273+
bool use_prob_map = false;
274+
if (cmdOptionExists(argv, argv + argc, "--prob-map"))
275275
{
276-
no_prob_map = true;
277-
printf("NoProbMap: true (uniform random ignition)\n");
276+
use_prob_map = true;
277+
printf("UseProbMap: true\n");
278278
}
279279

280280
// Floats and ints
@@ -676,7 +676,7 @@ parseArgs(int argc, char* argv[], arguments* args_ptr)
676676
args_ptr->Stats = out_stats;
677677
args_ptr->BBOTuning = bbo_tuning;
678678
args_ptr->AllowCROS = allow_cros;
679-
args_ptr->NoProbMap = no_prob_map;
679+
args_ptr->UseProbMap = use_prob_map;
680680
}
681681

682682
void

Cell2Fire/ReadArgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ typedef struct
1818
int IgnitionCell;
1919
bool OutMessages, OutFl, OutIntensity, OutRos, OutCrownConsumption, OutSurfConsumption, Trajectories,
2020
NoOutput, verbose, IgnitionsLog, Ignitions, OutputGrids, FinalGrid, PromTuned, Stats, BBOTuning, AllowCROS, UseWeatherWeights,
21-
NoProbMap;
21+
UseProbMap;
2222
float ROSCV, ROSThreshold, CROSThreshold, HFIThreshold, HFactor, FFactor, BFactor, EFactor, FirePeriodLen;
2323
float CBDFactor, CCFFactor, ROS10Factor, CROSActThreshold;
2424
int MinutesPerWP, MaxFirePeriods, TotalYears, TotalSims, NWeatherFiles, IgnitionRadius, seed, nthreads, FMC,

Cell2Fire/ReadCSV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ CSVReader::parseDFDirect(inputs* df_ptr, const std::string& filename, arguments*
525525
df_ptr->FMC = row[13].empty() ? args_ptr->FMC : std::stoi(row[13], &sz);
526526

527527
// col 14: probMap — fill ignProb, not stored in inputs
528-
ignProb[count] = (args_ptr->NoProbMap || row[14].empty()) ? 1.f : std::stof(row[14], &sz);
528+
ignProb[count] = (args_ptr->UseProbMap && !row[14].empty()) ? std::stof(row[14], &sz) : 1.f;
529529

530530
// col 15: jd
531531
df_ptr->jd = row[15].empty() ? 0 : std::stoi(row[15], &sz);

0 commit comments

Comments
 (0)