Model: Model

ModelR Documentation

Model

Description

Model is an R6 class that defines an object that generates all of the objects of the various classes (e.g., Compartment, CompartmentType) that define a simulation model. A Model object is immutable - it should not change over the course of simulation. Instead, we derive a Run object class that inherits from a Model.

Public fields

initial.conds

Initial Conditions

types

vector of CompartmentType objects

compartments

vector of Compartment objects

lineages

vector of Lineage objects

fixed.samplings

list of Lineage names and sampling times for plotting

Active bindings

initial.conds

Initial Conditions

types

vector of CompartmentType objects

compartments

vector of Compartment objects

lineages

vector of Lineage objects

fixed.samplings

list of Lineage names and sampling times for plotting

Methods

Public methods


Method new()

Usage
Model$new(settings = NA, name = NA)

Method get.initial.conds()

Usage
Model$get.initial.conds()

Method get.types()

Usage
Model$get.types()

Method get.compartments()

Usage
Model$get.compartments()

Method get.lineages()

Usage
Model$get.lineages()

Method get.names()

Usage
Model$get.names(listR6obj)

Method get.fixed.samplings()

Usage
Model$get.fixed.samplings()

Method clone()

The objects of this class are cloneable with this method.

Usage
Model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

require(twt)
# get path to example YAML file
path <- system.file('extdata', 'SI.yaml', package='twt')

# load file and parse to construct Model object
settings <- yaml.load_file(path)
mod <- Model$new(settings)

# display summary information (calls S3 print method)
mod


PoonLab/twt documentation built on Nov. 7, 2024, 4:18 a.m.