Allgeier-Lab / arrR

:package: Individual-based simulation model of artificial reefs
https://allgeier-lab.github.io/arrR/
GNU General Public License v3.0
1 stars 0 forks source link

✨Allowing to provide threshold matrix #114

Closed mhesselbarth closed 2 years ago

mhesselbarth commented 2 years ago

@kmunsterman

I didn't merge into your branch yet, because I didn't know if that would screw up something with your code. Have a look at the changes and merge if you want.

This allows you to do the following:

vals <- rcauchy(n = 8, location = 0.5, scale = 0.1) # this must be between 0 and 1
threshold_mat <- cbind(input_fishpop$id, vals)

result <- run_simulation(seafloor = input_seafloor, fishpop = input_fishpop,
                         parameters = parameters, threshold_mat = threshold_mat,  movement = "behav",
                         max_i = max_i, min_per_i = min_per_i, 
                         seagrass_each = seagrass_each, save_each = save_each)

This would use the created threshold values in the first line. If the argument threshold_mat is not provided, it uses the normal distribution with the mean and sd parameter as before.

P.S. If you merge, please don't delete the original branch. I still need to merge into development as well.