Closed codyevers closed 1 year ago
Also, this is specific to Patchmax, not Forsys.
This appears fixed after removing the area adjustment from patchmax and changing the sampling approach when the searching less than 100%
I've lost how to examine stand outputs in stand alone patchmax. pm$describe()
no longer exists, just pm$summarize()
Also, I'm not seeing a monotonic decrease in patch objective totals. Did the area weight automation get removed?
Sorry, I changed pm$describe()
to pm$summarize()
Also, you can pull the individual stands using pm$patch_stands
and additional patch stats using pm$patch_stats
.
How I've been judging monotonic decline is...
plot(pm$patch_stands$objective)
Message ID: @.***>
I'm seeing the same issue. This is great. I just need to investigate now.
Also, there's a chance in setting the sample fraction. Ex....
pm$random_sample(sample_frac = 1)
pm$search()
On Jan 20, 2023 at 8:39 AM -0800, Cody Evers @.***>, wrote:
Sorry, I changed
pm$describe()
topm$summarize()
Also, you can pull the individual stands using
pm$patch_stands
and additional patch stats usingpm$patch_stats
.How I've been judging monotonic decline is...
plot(pm$patch_stands$objective)
Message ID: @.***>
So, does this not give you a 1 sample frac?
pm$simulate(10, 1)
I added this to the end of my script:
patch.wts <- pm$summarize() %>% filter(DoTreat==1)
head(patch.wts)
plot(patch.wts$bioacre)
plot(pm$patch_stands$objective)
Not anymore... The way you run this now is:
pm$random_sample(1)
pm$simulation(10)
On Jan 20, 2023 at 8:48 AM -0800, Michelle Day @.***>, wrote:
So, does this not give you a 1 sample frac? pm$simulate(10, 1) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.Message ID: @.***>
Why did it work?
Make sure to pull the latest patchmax, clean and build
, then restart R. I think your package might be out of date.
Check to make sure that pm$patch_stats
doesn't have a field called objective_area
anymore.
If it does, it's probably out of date.
Actually, I think patchmax is working correctly (monotonic decline)
Well, I did that first thing this morning. I always do now. I'll try again.
pm$random_sample(1) Error: attempt to apply non-function pm$simulation(10) Error: attempt to apply non-function
Are you sure you pushed your changes? Also github desktop didn't alert me there were any, but I pulled anyway.
Good catch Michelle. Indeed, I forgot to push the update. It should be there now. Stupid mistake on my part.
pm$random_sample(1) 1330 (100%) stands randomly selected for search pm$simulation(10) Error: attempt to apply non-function pm$random_sample(1) pm$simulation(10) Error: unexpected symbol in "pm$random_sample(1) pm"
thoughts?
Got it. It is pm$simulate. I found it in the code. Patting myself on back now.
okay, at the patch level this is working, but something weird is happening. See attached script. The ONLY place I call "Am4RevBio" is in the plot call. Otherwise I am only using "bioacre" in the patchmax object. Yet when you look at patch_stands
output, the objective is clearly "Am4RevBio"
Testing_patchmax_monotonic_decline.txt
. I'm not even sure how this is possible. I looked at the plot
code in the script but it is too complicated for me to follow.
Ok, it's fixed now. The objectve in the pm$patch_stands
was being multiplied by the area. I forgot to fix this when I removed the area weighting from the objective search. See some additional comments that I made to your script describing some of the other recent changes I've made.
Looks good now.
Also works with patchmax within forsys.
Hooray!
Message ID: @.***>
While the new RNG seed will produce consistent results between runs, sampled stands within the same run are not consistent. In other words, each time a search occurs, a different set of 10% of stands are evaluated. This means that later ptach scores can be higher than ones already selected. I believe the solution is to assign the sample of a function that is only run once, and that the search will run on this same sample each time.