langgoap.MinimizeTrajectorySum#
- class MinimizeTrajectorySum(name, expression, weight=1.0)[source]#
Minimise the sum of
expressionover every expected state.The canonical shape for integral trajectory metrics — e.g. the Pac-Man ghost-proximity integral
sum(1 / distance_to_nearest_ghost(state) for state in plan)which penalises any plan step that passes close to a ghost.- Parameters:
name (str)
expression (Callable[[PlanningState], float])
weight (float)
- __init__(name, expression, weight=1.0)#
- Parameters:
name (str)
expression (Callable[[PlanningState], float])
weight (float)
- Return type:
None
Methods
__init__(name, expression[, weight])evaluate(plan)Attributes
weightnameexpression