lumix.core.enums.LXObjectiveSense¶
- class lumix.core.enums.LXObjectiveSense(value)[source]¶
Objective sense enumeration for optimization direction.
Defines whether the objective function should be minimized or maximized.
- MINIMIZE¶
Minimize the objective function Use for: Costs, distances, time, waste, deviations, risk Example: Minimize total transportation cost
- MAXIMIZE¶
Maximize the objective function Use for: Profit, revenue, efficiency, throughput, utility Example: Maximize total profit
Note
Every optimization model must have exactly one objective
Minimizing f(x) is equivalent to maximizing -f(x)
For multi-objective problems, use goal programming module
Examples
Setting objective direction:
# Maximize profit model = LXModel("production_plan") model.maximize( LXLinearExpression() .add_term(production, lambda p: p.profit) ) # Minimize cost model = LXModel("logistics") model.minimize( LXLinearExpression() .add_term(shipment, lambda s: s.cost) ) # Multi-objective (using goal programming) model.set_goal_mode("weighted") # Objectives defined via goal constraints
- __init__()¶
Attributes
- MINIMIZE = 'min'¶
- MAXIMIZE = 'max'¶