langgoap.UniformRandomAgentModel

langgoap.UniformRandomAgentModel#

class UniformRandomAgentModel(*, enumerate_actions, default)[source]#

Baseline AgentModel that draws uniformly from a legal set.

enumerate_actions returns the legal actions available to the modelled agent in state. sample picks one uniformly via the supplied RNG; expected() returns default because the mode of a uniform distribution is ill-defined — callers who want a particular point estimate should plug a smarter AgentModel implementation.

The default action is also returned when enumerate_actions yields an empty sequence (no legal moves).

Parameters:
  • enumerate_actions (Callable[[Mapping[str, Any]], Sequence[A]])

  • default (A)

__init__(*, enumerate_actions, default)[source]#
Parameters:
  • enumerate_actions (Callable[[Mapping[str, Any]], Sequence[A]])

  • default (A)

Return type:

None

Methods

__init__(*, enumerate_actions, default)

expected(state)

sample(state, rng)