lumix.goal_programming.objective_builder.combine_objectives¶
- lumix.goal_programming.objective_builder.combine_objectives(base_objective, goal_objective, goal_weight=1.0)[source]¶
Combine a base objective with goal programming objective.
This is useful when you have a primary objective function (e.g., maximize profit) and also want to incorporate goal constraints.
- Parameters:
base_objective (
LXLinearExpression) – Primary objective expressiongoal_objective (
LXLinearExpression) – Goal programming objective (sum of weighted deviations)goal_weight (
float) – Relative weight for goal objective (default: 1.0)
- Return type:
- Returns:
Combined objective expression
Example
>>> profit_expr = LXLinearExpression().add_term(profit, 1.0) >>> goal_expr = build_weighted_objective(relaxed_constraints) >>> # Combine: maximize profit - goal_deviations >>> combined = combine_objectives(profit_expr, goal_expr, goal_weight=0.1)