Description Usage Slots Built-in classes of control objects show methods for the built-in control objkects Make a control object from 'elemental' objects Set a custom control object show methods for custom control objects See Also Examples
Objects from the control class contain objects of a particular type of 'elemental' class as well as their associated parameters. For example, we may have a control class for DOR objects. This control class would contain all the DOR objects that we wish to use in our simulation as well as all of the parameters that we wish to use. The control class objects are associated with their elemental objects. For example, the control object for the DOR class would be a DOR_control object. Hence, this document details the generic properties of control classes.
1 2 3 4 5 6 7 | helper.show.control(fx, params)
make.control(elemental_objs, parameter_lists)
set.custom_control(elemental_class_name, make.print_method = T)
remove.show.custom_control(object_name)
|
fxA list of elemental objects of the same type.
paramsA list of parameters.
typeSet to 'control'.
control objectsThis is a list of the built-in control objects.
DOR_controlFor DOR objects, class.DOR
dep_controlFor dep objects, class.dep
emission_controlFor emission objects, class.emission
initial_reserve_controlFor initial_reserve objects, class.initial_reserve
stimulus_controlFor stimulus objects, class.stimulus
termination_controlFor termination objects, class.termination
show methods for the built-in control objkectsThis is a list of show methods for the built-in control objects:
show.DOR_controlFor DOR objects, class.DOR
show.dep_controlFor dep objects, class.dep
show.emission_controlFor emission objects, class.emission
show.initial_reserve_controlFor initial_reserve objects, class.initial_reserve
show.stimulus_controlFor stimulus objects, class.stimulus
show.termination_controlFor termination objects, class.termination
Each of these methods have a corresponding remove.show.X function. If a show method is removed, it may be reinstated with the code above.
control object from 'elemental' objectsTo create a control object from a list of 'elemental' objects:
Make sure that the type of control object that you want to make has been defined. If the type of control object that you wish to make has not been defined, see the following section for how to define a custom type of control object.
Use the make.control function
make.control( elemental_objs, parameter_lists )
elemental_objsEither a list of elemental objects of the same class or a single elemental object
parameter_listsA list of parameter lists for the function contained in the elemental objects. All parameters must be strings that have been previously specified as input. The parameter list need not be named. Unnamed parameters are set up in the order that they appear. Alternatively, one may specify which elemental object each parameter list belongs to. See example.
Returns a control object.
control objectTo set a custom control object:
set.custom_control( elemental_class_name, make.print_method )
elemental_class_nameA character string giving the name of an elemental class. See class.custom_elemental for setting and making custom elemental classes/objects.
make.print_methodA logical specifying whether or not to make a show method for printing the control object. Defaults to T.
Sets a control class If there were no errors, a message will be printed stating that the control class has been set. Note that the control object that is set will have the name "X_control", where "X" is the name of the elemental object.
show methods for custom control objectsWhenever a custom control object is set up, the default is that an associated show method is also defined. This show method can be removed by using the function remove.show.custom_control( object_name ).
set.custom_elemental For setting up custom elemental classes to make custom control objects.
e_show For the show methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #Make some 'DOR' objects:
linear_DOR = make.DOR( DOR_fx = linear_DOR_fx, name = "linear_DOR" )
exponential_DOR = make.DOR( DOR_fx = exponential_DOR_fx, name = "exponential_DOR" )
#Make parameter lists for each 'DOR' object.
#linear_DOR_fx has the parameters: 'max', 'scale', 'resp_times', 'rft_times', 'reserve_value'.
#The parameters 'max' and 'scale' are fixed within each simulation while the other parameters are inputs that change within each simulation. Hence, we put the name of the input that we want to use for these parameters.
linear_DOR_params = list( scale = 100, max = c(1, 0.5), resp_times = "resp_time", rft_times = "rft_time", reserve_value = "reserve" )
#Apply the same logic to the exponential DOR parameters:
#If we do not name the parameters in the list, they are applied in the order that they are specified.
exponential_DOR_params = list( 100, 1, "resp_time", "rft_time", "reserve" )
#Combine the parameter lists:
#If the lists are not named, they are specified in the order that they appear.
DOR_params = list( linear_DOR = linear_DOR_params, exponential_DOR_params )
#Put the DOR objects into a list:
DOR_list = list( linear_DOR, exponential_DOR )
#Make the control object
DOR_ctrl = make.control( DOR_list, DOR_params )
#If we only have one DOR object, we can directly specify them in the make.control() function without putting them inside another list.
#To make a custom control object
#Assume that you already have an elemental class, 'test' and and you want to make a 'test_control' object.
#This will define a 'test_control' class.
test_ctrl = set.custom_control( "test" )
#Then you use "make.control()" as shown above.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.