GOAPRS
A Goal-Oriented Action Planning (GOAP) implementation in Rust. This library provides a flexible and efficient way to implement autonomous agents that can plan sequences of actions to achieve specific goals.
Features
- Simple and intuitive API
- Efficient A* pathfinding algorithm
- Support for action costs and preconditions
- Flexible state representation
- Error handling with custom error types
Usage
Add this to your Cargo.toml:
[]
= "0.2.0"
Example
Here's a simple example of how to use the library:
use ;
If you want to visualize the plan you can use the GoapVizualizer::new():
let visualizer = new;
visualizer.visualize_plan?;
How it Works
GOAP (Goal-Oriented Action Planning) is an AI architecture that enables agents to plan sequences of actions to achieve specific goals. The system works by:
- Defining actions with preconditions and effects
- Specifying the current state of the world
- Setting a goal state to achieve
- Using A* pathfinding to find the optimal sequence of actions
The planner will find the most efficient path from the current state to the goal state, taking into account the cost of each action.
License
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.