add_objective_min_loss: Deprecated objective: minimize loss

View source: R/add_objectives.R

add_objective_min_lossR Documentation

Deprecated objective: minimize loss

Description

Minimize deterioration relative to the reference scenario. Positive changes in other planning units or features do not offset these losses.

Usage

add_objective_min_loss(x, actions = NULL, features = NULL, alias = NULL)

Arguments

x

A Problem object.

actions

Optional subset of actions to include in the objective. Values may match x$data$actions$id and, if present, x$data$actions$action_set. If NULL, all actions are included.

features

Optional subset of features to include in the objective. Values may match x$data$features$id and, if present, x$data$features$name. If NULL, all features are included.

alias

Optional identifier used to register this objective for multi-objective workflows.

Details

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.

Value

An updated Problem object.

Lifecycle

Deprecated since 1.4.0. Legacy calls retain the negative-part criterion. add_objective_min_effect() is not a mathematically equivalent replacement.

Repeated calls

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.

See Also

add_objective_max_benefit, add_effects

Examples

# 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


multiscape documentation built on Oct. 12, 2026, 5:08 p.m.