goal

Defines a goal for the GOAP agent.

Returns the builder instance for chained calls.


Defines and configures a goal for the GOAP agent using the provided builder.

Parameters

name

The name of the goal.

configure

A configuration function used to customize the goal builder.


fun goal(name: String, description: String? = null, value: (Double) -> Double = { cost -> exp(-cost) }, cost: Cost<State> = { 1.0 }, condition: Condition<State>): GOAPPlannerBuilder<State>(source)

Defines a goal for the GOAP agent.

Parameters

name

The name of the goal.

description

Optional description of the goal.

value

Goal value depending on the cost of reaching the goal. Default is exp(-cost).

cost

Heuristic estimate for the cost of reaching the goal. Default is 1.0.

condition

Condition determining when the goal is achieved.