GOAP Algorithm (+2)
GOAP Algorithm
GOAP uses A* pathfinding through state space:
- State Space: All possible combinations of world facts
- Actions: Transforms with preconditions and effects
- Heuristic: Estimated cost to reach goal from current state
- Optimal Path: Lowest-cost action sequence achieving goal
Action Definition
Action: action_name
Preconditions: {condition1: true, condition2: value}
Effects: {new_condition: true, changed_value: new_value}
Cost: numeric_value
Execution: llm|code|hybrid
Fallback: alternative_action
Execution Modes
| Mode | Description | Use Case |
|---|---|---|
| Focused | Direct action execution | Specific requested actions |
| Closed | Single-domain planning | Defined action set |
| Open | Creative problem solving | Novel solution discovery |