action

fun action(name: String, description: String? = null, precondition: (State) -> Boolean, belief: (State) -> State, cost: (State) -> Double = { 1.0 }, execute: suspend (AIAgentFunctionalContext, State) -> State)(source)

Defines an action available to the GOAP agent.

Parameters

name

The name of the action.

description

Optional description of the action.

precondition

Condition determining if the action can be performed.

belief

Optimistic belief of the state after performing the action.

cost

Heuristic estimate for the cost of performing the action. Default is 1.0.

execute

Subgraph defining how the action is performed.