lumix.goal_programming.goal.LXGoal¶
- class lumix.goal_programming.goal.LXGoal(id, constraint_name, priority, weight, constraint_sense, target_value=None, instance_id=None)[source]¶
Represents a single goal instance in goal programming.
Deviation variables are indexed by Goal instances, making deviations semantically meaningful: they measure achievement of specific goals rather than just constraint satisfaction.
This provides practical business value: - Bus assignment: “Route 5 needs 3 additional buses” (neg_dev) - Production: “Product A has 20 units excess inventory” (pos_dev) - Scheduling: “Department B is 5 hours over overtime limit” (pos_dev)
- Parameters:
- id¶
Unique identifier for this goal instance
- constraint_name¶
Name of the original constraint
- priority¶
Goal priority level (1=highest, 0=custom objective)
- weight¶
Weight within the same priority level
- constraint_sense¶
Type of constraint (LE, GE, EQ)
- target_value¶
Target RHS value if constant
- instance_id¶
ID of the original constraint instance (if indexed)
Examples
- Single goal (non-indexed constraint):
>>> goal = LXGoal( ... id="total_demand", ... constraint_name="demand_goal", ... priority=1, ... weight=1.0, ... constraint_sense=LXConstraintSense.GE, ... target_value=1000.0 ... )
- Per-product goals (indexed constraint):
>>> goals = [ ... LXGoal( ... id="demand_product_1", ... constraint_name="production_goal", ... priority=1, ... weight=1.0, ... constraint_sense=LXConstraintSense.GE, ... target_value=100.0, ... instance_id=1 ... ), ... LXGoal( ... id="demand_product_2", ... constraint_name="production_goal", ... priority=1, ... weight=1.0, ... constraint_sense=LXConstraintSense.GE, ... target_value=150.0, ... instance_id=2 ... ), ... ]
- __init__(id, constraint_name, priority, weight, constraint_sense, target_value=None, instance_id=None)¶
Methods
__init__(id, constraint_name, priority, ...)Attributes
-
constraint_sense:
LXConstraintSense¶