File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ DEFAULT_PERCENT_CONIFER = 50
2828DEFAULT_PERCENT_DEAD_FIR = 30
2929# maximum amount of time to take for simulation (seconds) (0 is unlimited)
3030MAXIMUM_TIME = 0
31- # amount of time between generating interim outputs (seconds)
32- INTERIM_OUTPUT_INTERVAL = 240
31+ # amount of time between generating interim outputs (seconds) (0 is no interim outputs)
32+ INTERIM_OUTPUT_INTERVAL = 0
3333# maximum number of simulations to do (0 is exactly 1 simulation per scenario)
3434MAXIMUM_SIMULATIONS = 10000
3535# maximum percent change in statistics between runs before results are consider stable [0 - 1]
Original file line number Diff line number Diff line change @@ -803,10 +803,15 @@ map<DurationSize, shared_ptr<ProbabilityMap>> Model::runIterations(
803803 constexpr auto CHECK_INTERVAL = std::chrono::seconds (1 );
804804 bool keep_checking{true };
805805 const bool is_limited = 0 != Settings::maximumTimeSeconds ();
806+ const bool with_interim = 0 != interim_save_interval_.count ();
806807 if (!is_limited)
807808 {
808809 logging::note (" No time limit being enforced since MAXIMUM_TIME = 0" );
809810 }
811+ if (!with_interim)
812+ {
813+ logging::note (" No interim outputs being generated since INTERIM_OUTPUT_INTERVAL = 0" );
814+ }
810815 while (keep_checking)
811816 {
812817 this ->last_checked_ = Clock::now ();
@@ -815,6 +820,12 @@ map<DurationSize, shared_ptr<ProbabilityMap>> Model::runIterations(
815820 std::this_thread::sleep_for (CHECK_INTERVAL);
816821 // set bool so other things don't need to check clock
817822 is_out_of_time_ = is_limited && runTime ().count () >= timeLimit ().count ();
823+ should_output_interim_ =
824+ with_interim && timeSinceLastSave ().count () >= interimTimeLimit ().count ();
825+ if (should_output_interim_ && interim_changed_)
826+ {
827+ saveProbabilities (all_probabilities[0 ], start_day, true );
828+ }
818829 logging::verbose (" Checking clock [%ld of %ld]" , runTime (), timeLimit ());
819830 keep_checking = (runs_left > 0 && !shouldStop ());
820831 }
You can’t perform that action at this time.
0 commit comments