Description Usage Arguments Format Details Slots See Also Examples
Makes a closure from the functions specified in the elemental
objects for a model and the parameters in the respective control
objects. Specifically, the closure is implemented as its own class.
1 2 3 4 5 |
conditions |
A list of conditions. See |
model_object |
A model object. |
In R
, closures are shown with the code with which they were defined. Hence, the actual information that is contained in the closure will not be shown. Here, we have a special show
function that shows the elemental function as well as the associated parameters in the closure. As with all show
functions in CAB
, the user is able to remove the show
method with remove.show.element_fx_closure()
and reinstate it with show.closure.helper
.
A closure
is a function that contains some variables with some set values, i.e., the function closes over these variables. In the CAB
package, the simulation of a model is done by creating closures using the functions that are specified in the elemental
objects and with parameters that have been specified in the control
objects. That is, each time a model is run with some parameters, each of the functions that are required to run the model are closed over the conditions for that particular combination of parameters.
element_fx
The elemental function.
condition_info
The parameters from the control object.
closure
The closure.
class.model.COR
For the example.
get.model_conditions
Where get.model_conditions
is a nice way to specify the conditions
argument for make.sim_functions
.
do.sim_fx
For calling the functions made by make.sim_functions
.
1 2 3 | # Following from the example in ?get.model_conditions
cond1 = get.model_conditions( my_COR, 1 )
my_sim_closures = make.sim_functions( cond1, my_COR )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.