| nl_get_fast_sensitivity | R Documentation |
Uses sensitivity from fast package to calculate
a series of model outputs according to the FAST alogrithm
nl_get_fast_sensitivity(result, criteria)
result
|
A nlexperiment result object |
criteria
|
Name of evaluation criteria |
Only works when parameter value sets are defined with
nl_param_fast function.
Criteria must be defined in experiment (see nl_experiment,
eval_criteria argument).
Sensitivity is callculated for every simulation iteration (run_id).
A data frame with sensitivity from simulation results for every simulation repetition (run_id)
## Not run:
experiment <- nl_experiment(
model_file = "models/Sample Models/Biology/Flocking.nlogo",
setup_commands = c("setup", "repeat 100 [go]"),
iterations = 5,
param_values = nl_param_fast(
world_size = 50,
population = 80,
max_align_turn = c(1, 5, 20),
max_cohere_turn = c(1, 3, 20),
max_separate_turn = c(1, 1.5, 20),
vision = c(1, 3, 10),
minimum_separation = c(1, 3, 10)
),
mapping = c(
max_align_turn = "max-align-turn",
max_cohere_turn = "max-cohere-turn",
max_separate_turn = "max-separate-turn",
minimum_separation = "minimum-separation",
world_size = "world-size",
),
step_measures = measures(
converged = "1 -
(standard-deviation [dx] of turtles +
standard-deviation [dy] of turtles) / 2",
mean_crowding =
"mean [count flockmates + 1] of turtles"
),
eval_criteria = criteria( # aggregate over iterations
c_converged = mean(step$converged),
c_mcrowding = mean(step$mean_crowding)
),
repetitions = 10, # repeat simulations 10 times
random_seed = 1:10
)
#run experiment
result <- nl_run(experiment, parallel = TRUE)
#get sensitivity data
sensitivity_data <- nl_get_fast_sensitivity(result, "c_converged")
## End(Not run)