AI Toolkit
Loading...
Searching...
No Matches
aitoolkit::goap::action< T > Class Template Referenceabstract

An action that can be performed on a blackboard. More...

#include <goap.hpp>

Public Member Functions

virtual float cost (const T &blackboard) const =0
 The cost of performing this action.
 
virtual bool check_preconditions (const T &blackboard) const =0
 Check if the preconditions for this action are met.
 
virtual void apply_effects (T &blackboard, bool dry_run) const =0
 Apply the effects of this action to the blackboard.
 

Detailed Description

template<blackboard_trait T>
class aitoolkit::goap::action< T >

An action that can be performed on a blackboard.

An action hae a cost, which is used during planning, if 2 actions have a similar effect, the one with the lowest cost will be chosen.

An action also has preconditions, which are used to determine if an action can be performed on a blackboard. If the preconditions are not met, the action will not be considered during planning.

Finally, an action has effects, which are applied to the blackboard when the action is performed.