langgoap.ScalarHeuristic#
- class ScalarHeuristic(*args, **kwargs)[source]#
Continuous state-value function consumed by MCTS rollouts.
Maps
(state, goal)onto[-1.0, +1.0]where higher values indicate states closer to satisfaction.+1.0is reserved for fully satisfied states (set automatically by_shape_reward()whenstate.satisfies(goal.conditions)), so implementations should return strictly less than+1.0for non-terminal states.Used instead of the default goal-condition-count reward when supplied to
MCTSStrategyor a rollout policy; gives UCB1 a continuous gradient on GOAP problems whose binary condition reward would otherwise collapse to a single value. Not required to be admissible (that’s an A* property); better-is-higher is the only contract.- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)