nl_param_oat R Documentation

Create parameter sets with "one-at-a-time" (OAT) approach

Description

Create parameter sets with "one-at-a-time" (OAT) approach

Usage

nl_param_oat(n, ...)

Arguments

n

Number of parameter sets per parameter

...

Named list of parameter ranges (numeric vectors) Minimum and maximum values are used as a range and median as the default value. Parameters with only 1 value are treated as constants.

Value

A data frame with parameter value sets

See Also

See also nl_param_lhs for latin cube and nl_param_fast for FAST parameter sampling.

Examples

# create 5 values for every parameter:
nl_param_oat(n = 5, P1 = c(1, 4, 10), P2 = c(4, 11, 20))

# using constant parameters:
nl_param_oat(n = 5, P1 = c(1, 4, 10), P2 = c(4, 11, 20), P3 = 6)

# define NetLogo experiment with OAT design:
experiment <- nl_experiment(
  model_file = "models/Sample Models/Biology/Flocking.nlogo",
  setup_commands = c("setup", "repeat 100 [go]"),
  iterations = 5,

  param_values = nl_param_oat(
    n = 25,                           # create 25 value sets per parameter
    max_align_turn = c(0, 5, 20),
    max_cohere_turn = c(0, 3, 20),
    max_separate_turn = c(0, 1.5, 20),
    vision = c(1, 3, 10),
    minimum_separation = c(0, 3, 10),
    .dummy = c(0,0.5,1),
    world_size = 50,
    population = 80
  ),
  mapping = nl_default_mapping,

  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(
    c_converged = mean(step$converged),
    c_mcrowding = mean(step$mean_crowding)
  ),

  repetitions = 10,                        # repeat simulations 10 times
  random_seed = 1:10

)