langgoap.TerminationPolicy

langgoap.TerminationPolicy#

class TerminationPolicy(*args, **kwargs)[source]#

Policy that decides whether the GOAP loop should terminate.

Implementations must be stateless / thread-safe and never raise; the observer wraps each call in a try/except as a last line of defence, but a well-behaved policy is fire-and-forget.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

should_terminate(state)

Inspect state (a GoapState dict) and return EarlyTermination to halt the run, or None to continue.

Attributes

name

Stable identifier used in logs and termination reasons.