Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user_seed parameter for nlm_mpd #83

Open
bniebuhr opened this issue Nov 30, 2021 · 1 comment
Open

user_seed parameter for nlm_mpd #83

bniebuhr opened this issue Nov 30, 2021 · 1 comment

Comments

@bniebuhr
Copy link

Is it possible to include a user_seed parameter for nlm_mpd, in a way similar to, e.g., nlm_gaussianfield or nlm_fbm?
This would be useful to create the very same landscapes with different degrees of clumpiness.

@bniebuhr
Copy link
Author

So far I have explored that doing this trick:

# function with user_seed
nlm_mpd_seed <- function(user_seed = 123, ...) {
  set.seed(user_seed)
  NLMR::nlm_mpd(...)
}

# parameters
param_df <- expand.grid(ncol = 100,
                        nrow = 100,
                        resolution = 100, 
                        roughness = c(seq(0.1, 1, 0.1), 2), #0.5,
                        rand_dev = 1 #c(0.1, 1, 5, 10, 100)
                        ) %>% 
  tibble::as_tibble()

# simulated landscapes
nlm_list = param_df %>% pmap(nlm_mpd_seed, user_seed = 123)

# plot
landscapetools::show_landscape(nlm_list)

but it would be nice to have it within the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant