Skip to contents

Declares the theory's formal model and adds a provenance entry. A formal model declared earlier is replaced. R does not change the theory in place, so assign the result.

Usage

tf_set_formal_model(theory, type, spec_ref = NULL)

Arguments

theory

A theory object (named list).

type

Formal-model type, one of "ode", "abm", "network", "sem" or "none". Any but "none" passes the checklist's formalisation item.

spec_ref

Optional reference to the model specification.

Value

The theory with the formal model set.

Examples

tf_theory("demo-1", "A demonstration theory") |>
  tf_set_formal_model("ode", spec_ref = "models/panic.ode")
#> $schema_version
#> [1] "1.1"
#> 
#> $id
#> [1] "demo-1"
#> 
#> $title
#> [1] "A demonstration theory"
#> 
#> $maturity
#> [1] "building"
#> 
#> $theory_form
#> [1] "network"
#> 
#> $provenance
#> $provenance[[1]]
#> $provenance[[1]]$step
#> [1] "1"
#> 
#> $provenance[[1]]$action
#> [1] "tf_theory"
#> 
#> $provenance[[1]]$detail
#> [1] "demo-1"
#> 
#> 
#> $provenance[[2]]
#> $provenance[[2]]$step
#> [1] "2"
#> 
#> $provenance[[2]]$action
#> [1] "tf_set_formal_model"
#> 
#> $provenance[[2]]$detail
#> [1] "ode"
#> 
#> 
#> 
#> $formal_model
#> $formal_model$type
#> [1] "ode"
#> 
#> $formal_model$spec_ref
#> [1] "models/panic.ode"
#> 
#>