langgoap.HeuristicRollout

langgoap.HeuristicRollout#

class HeuristicRollout(max_depth=4, scalar_heuristic=None)[source]#

Greedy rollout: pick the applicable action minimising h.

Reuses the A* admissible heuristic (count of unsatisfied goal conditions). Ties are broken by action-precondition specificity, mirroring A*’s expansion order. A scalar_heuristic may be supplied to replace the default binary reward shape at rollout leaves with a continuous value; action selection during rollout continues to use the integer admissible heuristic so the greedy choice rule is decoupled from the leaf value function.

Parameters:
__init__(max_depth=4, scalar_heuristic=None)#
Parameters:
Return type:

None

Methods

__init__([max_depth, scalar_heuristic])

rollout(*, state, goal, actions)

Attributes

max_depth

scalar_heuristic