View source: R/add_objectives.R
| add_objective_min_loss | R Documentation |
Minimize deterioration relative to the reference scenario. Positive changes in other planning units or features do not offset these losses.
add_objective_min_loss(x, actions = NULL, features = NULL, alias = NULL)
x |
A |
actions |
Optional subset of actions to include in the objective. Values
may match |
features |
Optional subset of features to include in the objective.
Values may match |
alias |
Optional identifier used to register this objective for multi-objective workflows. |
Let \Delta_{if}(x) be the signed change for planning unit i and
feature f, after combining selected individual actions and their
interaction corrections. The objective is
\min \sum_{i,f} \max(-\Delta_{if}(x), 0).
The positive/negative split is applied after joint aggregation within each unit and feature, before summing across units or features. A negative interaction correction does not itself represent a loss if the final change remains positive. Conversely, gains elsewhere cannot cancel deterioration.
With one action per unit this retains the existing loss-only criterion. With concurrent actions, an exact MILP linearization represents mixed-sign final losses in single-objective and all multi-objective methods, including when loss is constrained, has zero weight, or is evaluated after another objective is optimized. Non-negative effects give a valid zero-loss objective.
Action and feature subsets follow add_objective_max_benefit(): an
interaction is included only when all of its members belong to the scope.
An unselected unit contributes zero loss. Use targets or other objectives if
avoiding intervention altogether should not be an acceptable solution.
An updated Problem object.
Deprecated since 1.4.0. Legacy calls retain the negative-part criterion. add_objective_min_effect() is not a mathematically equivalent replacement.
With alias = NULL, one explicit single objective can be defined per
problem; a second unaliased definition raises an error. With an alias,
objectives accumulate under distinct names; a repeated alias raises an error.
Aliased definitions preserve an explicitly configured single objective.
To compare alternatives, start from the problem before its objective was added.
add_objective_max_benefit,
add_effects
# Load a complete simulated planning problem.
example_data <- load_sim_multiaction()
p <- create_problem(
pu = example_data$planning_units,
features = example_data$features,
dist_features = example_data$dist_features,
cost = "cost"
) |>
add_actions(
example_data$actions,
cost = example_data$action_costs
) |>
add_effects(
example_data$effect_assumptions
)
p1 <- add_objective_min_loss(p)
p1$data$model_args
p2 <- add_objective_min_loss(
p,
actions = "restore"
)
p2$data$model_args
p3 <- add_objective_min_loss(
p,
features = 1
)
p3$data$model_args
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.