action

Defines an action available to the GOAP agent.

Returns the builder instance for chained calls.


Defines and configures an action available to the GOAP agent using the provided builder.

Parameters

name

The name of the action.

configure

A configuration function used to customize the action builder.


fun action(name: String, description: String? = null, precondition: Condition<State>, belief: Belief<State>, cost: Cost<State> = { 1.0 }, execute: Execute<State>): GOAPPlannerBuilder<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.