Constant: Constant Class

ConstantR Documentation

Constant Class

Description

An element that defines a constant

Super class

biorisk::RiskElement -> Constant

Public fields

value

The value of the constant

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
Constant$new(name, value, output_unit = NA)
Arguments
name

A character defining the name for the element

value

The value of the constant

output_unit

A character with the unit of the output

Returns

A new instance of the element


Method simulate()

Make simulation. Returns a vector of length niter with self.value.

Usage
Constant$simulate(niter, check_units = FALSE)
Arguments
niter

Number of iterations (length of the vector).

check_units

Ignore.


Method simulate_level()

Simulation at some level for X-D Monte Carlo

Usage
Constant$simulate_level(niter0, iter1 = 1, level = 0)
Arguments
niter0

Number of iterations at the lower level

iter1

Iteration at the upper level

level

Level of the calculation (ignored, it always returns a vector to facilitate the mutates)


Method point_estimate()

Returns the value of the constant

Usage
Constant$point_estimate()

Method clone()

The objects of this class are cloneable with this method.

Usage
Constant$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


albgarre/biorisk documentation built on Feb. 23, 2025, 5:19 a.m.