langgoap.UtilityStrategy#
- class UtilityStrategy[source]#
Greedy one-step utility planner.
On each
plan()call:Filter to actions whose preconditions are satisfied by the current state and whose names are not in
blacklisted_actions.Score each by
_net_value().Return the highest-scoring action as a single-step
Plan. Ties tie-break by list order for stability.Return
Nonewhen no applicable action remains.
Pair with
policy=GoalPolicy(replan_strategy=ReplanStrategy.EVERY_ACTION)on the goal so the loop calls the planner again after every action — the utility model is iterative, not multi-step.- __init__()#
Methods
__init__()plan(start, goal, actions, *[, ...])Attributes
name