getConnectivityPenalty {prioriactions} | R Documentation |
Extract connectivity penalty values
Description
Provides the connectivity penalty value for all actions and planning units in a solution.
Usage
getConnectivityPenalty(x)
Arguments
x |
Details
The connectivity penalty among is calculated as the sum of all
connectivity penalties by each action and planning unit in the solution. This can be expressed
mathematically for a set of planning units
indexed by
and
, and
a set of threats
indexed by
as:
Where, is the decisions variable that specify
whether an action has been selected to abate threat
in planning unit
(1) or not (0),
is the connectivity penalty that applies
when a solution contains planning unit
but not
o viceversa.
Note that there is an action per threat, so it is assumed that the index of the threat coincides with the index of the action used to abate it.
Value
Examples
# set seed for reproducibility
set.seed(14)
## Load data
data(sim_pu_data, sim_features_data, sim_dist_features_data,
sim_threats_data, sim_dist_threats_data, sim_sensitivity_data,
sim_boundary_data)
## Create data instance
problem_data <- inputData(
pu = sim_pu_data, features = sim_features_data, dist_features = sim_dist_features_data,
threats = sim_threats_data, dist_threats = sim_dist_threats_data,
sensitivity = sim_sensitivity_data, boundary = sim_boundary_data
)
## Create optimization model
problem_model <- problem(x = problem_data, blm = 0.03)
## Solve the optimization model
s <- solve(a = problem_model, time_limit = 2, output_file = FALSE, cores = 2)
# get connectivity penalty values
getConnectivityPenalty(s)
[Package prioriactions version 0.5.0 Index]