This class is used to represent conservation planning problems.
It stores the data (e.g., planning units, and features) and
mathematical formulation (e.g., the objective, constraints,
and other design criteria) needed to generate prioritizations.
Most users should use problem() to generate new conservation problem
objects, and the functions distributed with the package to interact
with them (e.g., number_of_features(), number_of_planning_units()).
Only experts should use the fields and methods for this class directly.
Public fields
datalistcontaining data (e.g., planning units, costs).defaultslistindicating if other fields contain defaults.objectiveObjectiveobject specifying the objective function for the problem formulation.decisionsDecisionobject specifying the decision types for the problem formulation.targetsTargetobject specifying the representation targets for the problem formulation.weightsWeightobject specifying the feature weights for the problem formulation.constraintslistcontainingConstraintobjects that specify constraints for the problem formulation.penaltieslistcontainingPenaltyobjects that specify penalties for the problem formulation.portfolioPortfolioobject specifying the approach for generating multiple solutions.solverSolverobject specifying the solver for generating solutions.
Methods
Public methods
ConservationProblem$planning_unit_indices_with_finite_costs()ConservationProblem$set_planning_unit_indices_with_finite_costs()ConservationProblem$set_feature_abundances_in_planning_units()ConservationProblem$feature_positive_abundances_in_planning_units()ConservationProblem$set_feature_positive_abundances_in_planning_units()ConservationProblem$set_feature_abundances_km2_in_total_units()
ConservationProblem$new()
Create a new conservation problem object.
Usage
ConservationProblem$new(data = list())ConservationProblem$get_data()
Get values stored in the data field.
Returns
An object. If the data field does not contain an object
associated with x, then a new_waiver() object is
returned.
ConservationProblem$set_data()
Set values stored in the data field. Note that this method will
overwrite existing data.
ConservationProblem$number_of_planning_units()
Obtain the number of planning units. The planning units correspond to
elements in the cost data
(e.g., indices, rows, geometries, cells) that have finite
values in at least one zone. In other words, planning unit are
elements in the cost data that do not have missing (NA) values in
every zone.
ConservationProblem$is_ids_equivalent_to_indices()
Check if planning unit identifiers are equivalent to the planning
unit indices? Only FALSE if the planning units are
data.frame format.
ConservationProblem$planning_unit_indices_with_finite_costs()
Obtain the planning unit indices that are associated with finite cost values.
ConservationProblem$set_planning_unit_indices_with_finite_costs()
Perform calculations to cache the planning unit indices that are associated with finite cost values.
ConservationProblem$number_of_total_units()
Obtain the number of total units. The total units include all elements
in the cost data
(e.g., indices, rows, geometries, cells), including those with
missing (NA) values.
ConservationProblem$set_planning_unit_costs()
Perform calculations to cache the planning unit costs.
ConservationProblem$feature_abundances_in_planning_units()
Obtain the abundance of the features in the planning units.
ConservationProblem$set_feature_abundances_in_planning_units()
Perform calculations to cache the abundance of the features in the planning units.
ConservationProblem$feature_positive_abundances_in_planning_units()
Obtain the positive abundance of the features in the planning units.
Note that this method, unlike feature_abundances_in_planning_units,
ConservationProblem$set_feature_positive_abundances_in_planning_units()
Perform calculations to cache the positive abundance of the features in the planning units.
ConservationProblem$feature_abundances_in_total_units()
Obtain the abundance of the features in the total units.
ConservationProblem$feature_abundances_km2_in_total_units()
Obtain the abundance of the features in area-based units of km2.
ConservationProblem$set_feature_abundances_km2_in_total_units()
Perform calculations to cache the abundance of the features in area-based units of km2.
ConservationProblem$feature_targets()
Obtain the representation targets for the features.
Returns
A tibble::tibble() data frame.
ConservationProblem$feature_weights()
Obtain the weights for the features.
Returns
A tibble::tibble() data frame.
ConservationProblem$has_negative_feature_data()
See if the feature data contain any negative values.
ConservationProblem$add_portfolio()
Create a new object with a portfolio added to the problem formulation.
Arguments
xPortfolio object.
ConservationProblem$add_solver()
Create a new object with a solver added to the problem formulation.
Arguments
xSolver object.
ConservationProblem$add_targets()
Create a new object with targets added to the problem formulation.
Arguments
xTarget object.
ConservationProblem$add_weights()
Create a new object with weights added to the problem formulation.
Arguments
xWeight object.
ConservationProblem$add_objective()
Create a new object with an objective added to the problem formulation.
Arguments
xObjective object.
ConservationProblem$add_decisions()
Create a new object with decisions added to the problem formulation.
Arguments
xDecision object.
ConservationProblem$add_constraint()
Create a new object with a constraint added to the problem formulation.
Arguments
xConstraint object.
ConservationProblem$add_penalty()
Create a new object with a penalty added to the problem formulation.
Arguments
xPenalty object.
ConservationProblem$remove_all_penalties()
Create a new object without any penalties.
