lumix.goal_programming.goal.LXGoalMetadata

class lumix.goal_programming.goal.LXGoalMetadata(priority, weight, constraint_sense, undesired_deviations=<factory>)[source]

Metadata for a goal constraint in goal programming.

A goal constraint is a soft constraint that can be violated with a penalty. The goal is transformed by adding deviation variables:

  • For LE: expr + neg_dev - pos_dev == rhs (minimize pos_dev)

  • For GE: expr + neg_dev - pos_dev == rhs (minimize neg_dev)

  • For EQ: expr + neg_dev - pos_dev == rhs (minimize both)

Parameters:
priority

Priority level (1=highest, 2=second highest, etc.) Priority 0 is reserved for custom objective terms

weight

Relative weight within the same priority level

constraint_sense

Original constraint type (LE, GE, EQ)

undesired_deviations

Set of deviation types to minimize (‘pos’, ‘neg’, or both)

__init__(priority, weight, constraint_sense, undesired_deviations=<factory>)
Parameters:
Return type:

None

Methods

__init__(priority, weight, constraint_sense)

is_custom_objective()

Check if this is a custom objective term (priority 0).

is_neg_undesired()

Check if negative deviation should be minimized.

is_pos_undesired()

Check if positive deviation should be minimized.

Attributes

priority: int
weight: float
constraint_sense: LXConstraintSense
undesired_deviations: Set[str]
__post_init__()[source]

Determine undesired deviations based on constraint sense.

is_custom_objective()[source]

Check if this is a custom objective term (priority 0).

Return type:

bool

is_pos_undesired()[source]

Check if positive deviation should be minimized.

Return type:

bool

is_neg_undesired()[source]

Check if negative deviation should be minimized.

Return type:

bool

__init__(priority, weight, constraint_sense, undesired_deviations=<factory>)
Parameters:
Return type:

None