langgoap.HardSoftScore#
- class HardSoftScore(hard=0.0, soft=0.0)[source]#
A two-level score with hard and soft components.
hardis bounded above by 0. A feasible plan hashard == 0.0; every hard-constraint violation subtracts its penalty amount.softhas no sign restriction — maximize objectives push it positive, minimize objectives and soft-constraint violations push it negative.Comparison is lexicographic: a plan with a greater (less-negative)
hardis strictly better; ties break bysoft(greater is better). Using>is more natural than<because rewards accumulate positively.- Parameters:
hard (float)
soft (float)
- __init__(hard=0.0, soft=0.0)#
- Parameters:
hard (float)
soft (float)
- Return type:
None
Methods
__init__([hard, soft])is_feasible()Return True if this score represents a feasible plan.
Attributes
hardsoftvalueSum of the two levels.