| 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
charactername of object.- $parameters
listobject used to customize the modifier.- $data
listobject with data.- $compressed_formulation
logicalcan 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
charactername for object- value
any object
- id
idornameof parameter- cp
ProjectProblem object
- op
OptimizationProblem object
Details
print the object.
- show
show the object.
- repr
return
characterrepresentation of the object.- get_data
return an object stored in the
datafield with the correspondingname. If the object is not present in thedatafield, awaiverobject is returned.- set_data
store an object stored in the
datafield with the corresponding name. If an object with that name already exists then the object is overwritten.- calculate
functionused 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 thedataslot of the inputProjectModifierorProjectProblemobjects.- output
functionused to generate an output from the object. This method is only used for Target objects.- apply
functionused 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
listcontaining 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.