class.termination: Termination Function class

Description Usage Format Details Slots Built-in Termination functions Make an termination object from a Termination function See Also Examples

Description

Termination functions are general functions for representing the stopping conditions for an experiment.

Usage

1
2
3

Format

The show method prints the function that is contained in the termination object as well as the type of object (i.e. "elemental") and the class (i.e. "termination" ).

Details

In the CAB package, objects from classes like termination are called 'elemental' objects That is, they comprise a particular element of the simulation without any specified parameter values. 'Control' objects are elemental objects with an associated list of parameter values. Refer to class.DOR for information for putting a termination in a model.

When the termination object is used to contain many termination condtiions, each termination condition should be programmed into a single Termination function that is contained in the termination object. Alternatively, one may define different custom classes to manage each termination condition. For more details on implementing multiple classes for multiple termination conditions, see class.termination.

The show method for the termination class can be removed with the function remove.termination.show() and reinstated with termination.show.

Slots

termination

This will contain a Termination function. See examples.

name

The name of the termination object.

type

This will be elemental because the termination is an termination object.

Built-in Termination functions

A list of the built-in Termination functions. The function definitions can be seen by calling the name of the function without brackets. Each function returns a logical indicating whether or not the termination condition is met.

time_termination_fx( time, finish_time)

Experimental terminates after the set time.

resp_termination_fx( resp, finish_resp)

Experiment terminates after set number of responses.

Make an termination object from a Termination function

Use the make.termination function to make a termination object.

Usage

make.termination( termination_fx, name )

Arguments

termination_fx

A function that represents the Termination function of interest

name

A character vector specifying the name of your termination object

Value

Returns a termination object.

See Also

make.control for making DOR_control objects.

set.custom_elemental for setting custom elemental classes.

make.custom_elemental for making custom elemental objects.

e_show for the function that is called by the show method.

class.elemental for the parent elemental class.

Examples

1
2
3
4
5
# Terminate the experiemnt at 3000 responses
# Look at the definition of the "resp_termination_fx" Termination function
resp_termination_fx
# Make a termiantion object out of the "resp_termination_fx" Termination function
resp_termination = make.termination( termination_fx = resp_termination_fx, name = "resp_termination" )

Don-Li/CAB_original documentation built on May 6, 2019, 2:53 p.m.