langgoap.MaxWallClockPolicy

langgoap.MaxWallClockPolicy#

class MaxWallClockPolicy(seconds, name='MaxWallClockPolicy')[source]#

Terminate after seconds of wall-clock time since the run started.

Reads state['wall_clock_started_at'], the epoch timestamp (time.time()) the planner stores on its first invocation (see GoapPlanner). Epoch seconds survive a checkpoint resume in another process, which a time.monotonic() reading would not (issue #50). Until the planner has set the anchor the policy returns None; construction time is intentionally not the start anchor so a long-lived GoapGraph does not bleed wall-clock between runs.

Parameters:
  • seconds (float)

  • name (str)

__init__(seconds, name='MaxWallClockPolicy')#
Parameters:
  • seconds (float)

  • name (str)

Return type:

None

Methods

__init__(seconds[, name])

should_terminate(state)

Attributes

seconds

name