Learn R Programming

prioritizr (version 4.1.5)

ConservationProblem-class: Conservation problem class

Description

This class is used to represent conservation planning problems. A conservation planning problem has spatially explicit planning units. A prioritization involves making a decision on each planning unit (e.g. is the planning unit going to be turned into a protected area?). Each planning unit is associated with a cost that represents the cost incurred by applying the decision to the planning unit. The problem also has a set of representation targets for each feature. Further, it also has constraints used to ensure that the solution meets additional objectives (e.g. certain areas are locked into the solution). Finally, a conservation planning problem---unlike an optimization problem---also requires a method to solve the problem. This class represents a planning problem, to actually build and then solve a planning problem, use the problem function. Only experts should use this class directly.

Fields

$data

list object containing data.

$objective

Objective-class object used to represent how the targets relate to the solution.

$decisions

Decision-class object used to represent the type of decision made on planning units.

$targets

Target-class object used to represent representation targets for features.

$penalties

Collection-class object used to represent additional penalties that the problem is subject to.

$constraints

Collection-class object used to represent additional constraints that the problem is subject to.

$portfolio

Portfolio-class object used to represent the method for generating a portfolio of solutions.

$solver

Solver-class object used to solve the problem.

Usage

x$print()

x$show()

x$repr()

x$get_data(name)

x$set_data(name, value)

x$number_of_total_units()

x$number_of_planning_units()

x$planning_unit_indices()

x$planning_unit_indices_with_finite_costs()

x$planning_unit_costs()

x$number_of_features()

x$feature_names()

x$feature_abundances_in_planning_units()

x$feature_abundances_in_total_units()

x$feature_targets()

x$number_of_zones()

x$zone_names()

x$add_objective(obj)

x$add_decisions(dec)

x$add_portfolio(pol)

x$add_solver(sol)

x$add_constraint(con)

x$add_targets(targ)

x$get_constraint_parameter(id)

x$set_constraint_parameter(id, value)

x$render_constraint_parameter(id)

x$render_all_constraint_parameters()

x$get_objective_parameter(id)

x$set_objective_parameter(id, value)

x$render_objective_parameter(id)

x$render_all_objective_parameters()

x$get_solver_parameter(id)

x$set_solver_parameter(id, value)

x$render_solver_parameter(id)

x$render_all_solver_parameters()

x$get_portfolio_parameter(id)

x$set_portfolio_parameter(id, value)

x$render_portfolio_parameter(id)

x$render_all_portfolio_parameters()

x$get_penalty_parameter(id)

x$set_penalty_parameter(id, value)

x$render_penalty_parameter(id)

x$render_all_penalty_parameters()

Arguments

name

character name for object.

value

an object.

obj

Objective-class object.

dec

Decision-class object.

con

Constraint-class object.

pol

Portfolio-class object.

sol

Solver-class object.

targ

Target-class object.

cost

RasterLayer-class, SpatialPolygonsDataFrame-class, or SpatialLinesDataFrame-class object showing spatial representation of the planning units and their cost.

features

Zones-class or data.frame object containing feature data.

id

Id object that refers to a specific parameter.

value

object that the parameter value should become.

Details

print

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 corresponding name. If the object is not present in the data field, a waiver 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.

number_of_planning_units

integer number of planning units.

planning_unit_indices

integer indices of the planning units in the planning unit data.

planning_unit_indices_with_finite_costs

list of integer indices of planning units in each zone that have finite cost data.

number_of_total_units

integer number of units in the cost data including units that have N cost data.

planning_unit_costs

matrix cost of allocating each planning unit to each zone. Each column corresponds to a different zone and each row corresponds to a different planning unit.

number_of_features

integer number of features.

feature_names

character names of features in problem.

feature_abundances_in_planning_units

matrix total abundance of each feature in planning units available in each zone. Each column corresponds to a different zone and each row corresponds to a different feature.

feature_abundances_in_total_units

matrix total abundance of each feature in each zone. Each column corresponds to a different zone and each row corresponds to a different feature.

feature_targets

tibble with feature targets.

number_of_zones

integer number of zones.

zone_names

character names of zones in problem.

add_objective

return a new ConservationProblem-class with the objective added to it.

add_decisions

return a new ConservationProblem-class object with the decision added to it.

add_portfolio

return a new ConservationProblem-class object with the portfolio method added to it.

add_solver

return a new ConservationProblem-class object with the solver added to it.

add_constraint

return a new ConservationProblem-class object with the constraint added to it.

add_targets

return a copy with the targets added to the problem.

get_constraint_parameter

get the value of a parameter (specified by argument id) used in one of the constraints in the object.

set_constraint_parameter

set the value of a parameter (specified by argument id) used in one of the constraints in the object to value.

render_constraint_parameter

generate a shiny widget to modify the value of a parameter (specified by argument id).

render_all_constraint_parameters

generate a shiny div containing all the parameters' widgets.

get_objective_parameter

get the value of a parameter (specified by argument id) used in the object's objective.

set_objective_parameter

set the value of a parameter (specified by argument id) used in the object's objective to value.

render_objective_parameter

generate a shiny widget to modify the value of a parameter (specified by argument id).

render_all_objective_parameters

generate a shiny div containing all the parameters' widgets.

get_solver_parameter

get the value of a parameter (specified by argument id) used in the object's solver.

set_solver_parameter

set the value of a parameter (specified by argument id) used in the object's solver to value.

render_solver_parameter

generate a shiny widget to modify the value of a parameter (specified by argument id).

render_all_solver_parameters

generate a shiny div containing all the parameters' widgets.

get_portfolio_parameter

get the value of a parameter (specified by argument id) used in the object's portfolio.

set_portfolio_parameter

set the value of a parameter (specified by argument id) used in objects' solver to value.

render_portfolio_parameter

generate a shiny widget to modify the value of a parameter (specified by argument id).

render_all_portfolio_parameters

generate a shiny div containing all the parameters' widgets.