AI Toolkit
|
A plan is a sequence of actions that will lead to a goal state. More...
#include <goap.hpp>
Public Member Functions | |
size_t | size () const |
Get the number of actions in the plan. | |
operator bool () const | |
Check if the plan is empty. | |
void | run_next (T &blackboard) |
Execute the next planned action. | |
Friends | |
plan< T > | planner (std::vector< action_ptr< T > > actions, T initital_blackboard, T goal_blackboard, size_t max_iterations) |
Create a plan. | |
A plan is a sequence of actions that will lead to a goal state.
|
friend |
Create a plan.
The plan is created by providing a list of actions, an initial blackboard state, and a goal blackboard state. The plan will then find a sequence of actions that will lead to the goal state.
actions | The list of actions that can be performed. |
initital_blackboard | The initial state of the blackboard. |
goal_blackboard | The goal state of the blackboard. |
max_iterations | The maximum number of iterations to perform before giving up. If 0, the plan will run until it finds a solution. |