Closed codyevers closed 1 year ago
something weird is happening, it keeps building and recording patches past the 10 (it errors out at patch 44 but what is it making so many patches?). What am I doing wrong here?
run_outputs_exclimit = forsys::run( return_outputs = TRUE, write_outputs = TRUE, stand_data = shp, scenario_name = "forsys_exclimit", stand_id_field = "LMU_ID", stand_area_field = "Acres", global_threshold = 'OwnerClass == "USDA FOREST SERVICE"', scenario_priorities = c("res_depart_SPM"), scenario_output_fields = c("Acres", "Am4RevBio_PCP", "prob_8p_PCP", "res_depart_PCP"), run_with_patchmax = TRUE, patchmax_proj_size = 500, patchmax_proj_number = 10, patchmax_SDW = 1, patchmax_EPW = 0, patchmax_sample_frac = 1, patchmax_exclusion_limit = 1 )
Turns out this was an unrelated bug. Should be fixed now.
@michelledayusfs Can you double check that patchmax stops correctly after X number of projects AND/OR the annual_target
? Thanks
Also, if I set patchmax_sample_frac to 0.6 (and I have both global and stand thresholds) why is it sampling 44% of the stands?
Okay, @codyevers , please see the attached script. This is treating things that don't meet my global threshold. If you set the stand threshold to 2, it is even worse. But it looks like the exclusion limit is working. :)
You're right: the filtering_function wasn't working (wihch means it also wasn't working with the SPM and PCP calculations). Nice catch. It's fixed now.
Working now, as well as exclusion_limit. Closing issue.
I've added a new parameter to
forsys::run
calledpatchmax_exclusion_limit
. This is tranferred directly to the patchmax wrapper. @michelledayusfs can you confirm this is completed?