ProjectModifier-class {oppr} | R Documentation |
Conservation problem modifier prototype
Description
This super-prototype is used to represent prototypes that in turn are used to modify a ProjectProblem object. Specifically, the Constraint, Decision, Objective, and Target prototypes inherit from this class. Only experts should interact with this class directly because changes to these class will have profound and far reaching effects.
Fields
- $name
character
name of object.- $parameters
list
object used to customize the modifier.- $data
list
object with data.- $compressed_formulation
logical
can this constraint be applied to the compressed version of the conservation planning problem?. Defaults toTRUE
.
Usage
x$print()
x$show()
x$repr()
x$get_data(name)
x$set_data(name, value)
x$calculate(cp)
x$output()
x$apply(op,cp)
x$get_parameter(id)
x$get_all_parameters()
x$set_parameter(id, value)
x$render_parameter(id)
x$render_all_parameter()
Arguments
- name
character
name for object- value
any object
- id
id
orname
of parameter- cp
ProjectProblem object
- op
OptimizationProblem object
Details
print the object.
- show
show the object.
- repr
return
character
representation of the object.- get_data
return an object stored in the
data
field with the correspondingname
. If the object is not present in thedata
field, awaiver
object is returned.- set_data
store an object stored in the
data
field with the corresponding name. If an object with that name already exists then the object is overwritten.- calculate
function
used to perform preliminary calculations and store the data so that they can be reused later without performing the same calculations multiple times. Data can be stored in thedata
slot of the inputProjectModifier
orProjectProblem
objects.- output
function
used to generate an output from the object. This method is only used for Target objects.- apply
function
used to apply the modifier to an OptimizationProblem object. This is used by Constraint, Decision, and Objective objects.- get_parameter
retrieve the value of a parameter.
- get_all_parameters
generate
list
containing all the parameters.- set_parameter
change the value of a parameter to new value.
- render_parameter
generate a shiny widget to modify the the value of a parameter (specified by argument
id
).- render_all_parameters
generate a
shiny::div()
containing all the parameters" widgets.