langgoap.UtilityStrategy

langgoap.UtilityStrategy#

class UtilityStrategy[source]#

Greedy one-step utility planner.

On each plan() call:

  1. Filter to actions whose preconditions are satisfied by the current state and whose names are not in blacklisted_actions.

  2. Score each by _net_value().

  3. Return the highest-scoring action as a single-step Plan. Ties tie-break by list order for stability.

  4. Return None when 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