nl_default_mapping: Default mapping from R names to NetLogo variables

Description Usage Arguments Value Examples

Description

Creates mapping with simple rule: changes every character _. to ? and _ to -.

Usage

1
nl_default_mapping(param_values)

Arguments

param_values

Parameter values in list or data frame

Value

Named vector with default mapping. Use as function argument in nl_experiment mapping.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
param_values = list(
  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),
  .dummy = c(1:0)
)

nl_default_mapping(param_values)

# Define experiment mapping with a function instead of named vector:
experiment <- nl_experiment(
  model_file = "models/Sample Models/Biology/Flocking.nlogo",

  param_values = list(
    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),
    .dummy = c(1:0)
  ),
  mapping = nl_default_mapping
)

# check experiment parameter names mapping
cbind(experiment$mapping)

bergant/nlexperiment documentation built on May 12, 2019, 3:05 p.m.