openmi.om.base: The base object class for meta-model components

openmi.om.baseR Documentation

The base object class for meta-model components

Description

Class providing the minimum attributes and methods for a model component

Details

Has standard methods for iterating through timesteps and connecting with other components

Value

R6 class of type openmi.om.base

Public fields

name

is a unique identifier for this controller

code

is a unique identifier for this controller

debug

mode on/off

value

at current instance

data

from the larger context, including the parent. was arData in om

state

this objects local state. was state in om

inputs

linked to this object

components

contained by this object

host

name

type

of component

compid

is a unique identifier in this simulation domain

vars

is an array of variables that this requires for solving, determines op order

timer

is the object keepign time in simulation (set by parent controller)

id

is identifier (compid, name duplicates?)

Methods

Public methods


Method new()

Usage
openmi.om.base$new(elem_list = list(), format = "raw")
Arguments
elem_list

which properties to set on creation

format

format of elem_list

Returns

R6 class object


Method settable()

Usage
openmi.om.base$settable()
Returns

array of settable properties


Method set_prop()

Usage
openmi.om.base$set_prop(propname, propvalue, format = "raw")
Arguments
propname

which attribute

propvalue

what value

format

of propvalue

Returns

NA


Method parse_openmi()

Usage
openmi.om.base$parse_openmi(propvalue)
Arguments
propvalue

openmi formatted property list

Returns

a settable data value from openmi json type data description


Method parse_class_specific()

Usage
openmi.om.base$parse_class_specific(propvalue)
Arguments
propvalue

from some custom classformat reading implementation

Returns

a settable data value


Method set_sub_prop()

set the value of a contained component (not a local class attribute)

Usage
openmi.om.base$set_sub_prop(propname, propvalue, format = "raw")
Arguments
propname

which attribute

propvalue

what value

format

of propvalue

Returns

a settable data value


Method init()

initialize this component after first object creation

Usage
openmi.om.base$init()
Returns

NULL


Method set_vars()

set_vars finds all the input var names for this function

Usage
openmi.om.base$set_vars()
Returns

NULL


Method log_debug()

log_debug handles debug info

Usage
openmi.om.base$log_debug(debug_mesg)
Arguments
debug_mesg

message to add to logger

Returns

NULL


Method getInputs()

get all input values from linked components

Usage
openmi.om.base$getInputs()
Returns

NULL


Method prepare()

execute things to do before model timestep execution

Usage
openmi.om.base$prepare()
Returns

NULL


Method step()

perform model timestep execution

Usage
openmi.om.base$step()
Returns

NULL


Method stepChildren()

execute child model timestep code

Usage
openmi.om.base$stepChildren()
Returns

NULL


Method update()

execute model timestep code

Usage
openmi.om.base$update()
Returns

NULL


Method finish()

do things at end of model step

Usage
openmi.om.base$finish()
Returns

NULL


Method validate()

Is this object valid?

Usage
openmi.om.base$validate()
Returns

logical TRUE/FALSE


Method logState()

log data at end of timestep

Usage
openmi.om.base$logState()
Returns

NULL


Method getValue()

get value of this object currently

Usage
openmi.om.base$getValue(name = "value")
Arguments
name

a specific name from the state array, not just the default. TBD

Returns

value


Method addInput()

connect an input to this component

Usage
openmi.om.base$addInput(
  local_name = character(),
  object = openmi.om.base,
  remote_name = "",
  input_type = "numeric"
)
Arguments
local_name

name that will be referred to in local contest

object

is the actual R6 class to connect to

remote_name

is what property on the remote object are we accessing

input_type

is this is a number (most common), text or other?

Returns

value


Method addComponent()

add a contained sub-component (i.e. not linked)

Usage
openmi.om.base$addComponent(thiscomp = openmi.om.base)
Arguments
thiscomp

an R6 classof open.mi type

Returns

value


Method add_component()

add a contained sub-component (i.e. not linked)

Usage
openmi.om.base$add_component(thiscomp = openmi.om.base)
Arguments
thiscomp

an R6 classof open.mi type

Details

components are small objects that reside inside this object

Returns

NULL


Method get_component_id()

return unique ID of component

Usage
openmi.om.base$get_component_id(thiscomp)
Arguments
thiscomp

an R6 classof open.mi type

Returns

integer


Method orderOperations()

order contained sub-components

Usage
openmi.om.base$orderOperations()
Returns

NULL


Method asJSON()

format this object as openmi json

Usage
openmi.om.base$asJSON()
Returns

json text


Method clone()

The objects of this class are cloneable with this method.

Usage
openmi.om.base$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

NA

Examples

NA

HARPgroup/openmi-om documentation built on March 4, 2023, 6:56 p.m.