Grail (C++)  1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::PlannerReasoner Class Referencefinal

A reasoner which uses planners to find optimal sequences of behaviors based on goals. More...

#include <PlannerReasoner.hh>

Inheritance diagram for grail::PlannerReasoner:
Collaboration diagram for grail::PlannerReasoner:

Classes

struct  Config
 

Public Member Functions

 PlannerReasoner (std::unique_ptr< MemoryPool > memory)
 
 PlannerReasoner (std::unique_ptr< MemoryPool > memory, std::shared_ptr< planning::GoalSelector > goalSelector, std::unique_ptr< planning::DomainTranslator > domainTranslator, const Config &config)
 
virtual void SelectBehavior (AIEntity &entity) override
 selectBehavior - Runs reasoner's selection algorithm and assigns chosen behavior to provided entity. More...
 
virtual void SetNewGoal (std::unique_ptr< planning::Goal > newGoal, AIEntity &entity) override
 
void SetupNewPlanner (std::unique_ptr< planning::DomainTranslator > domainTranslator, const Config &config)
 
void SetFallbackBehavior (std::unique_ptr< Behavior > behavior)
 Sets the behavior that should be performed during plan computation or if no valid plan is found.
 
virtual const planning::GoalGetCurrentGoal () const override
 
void BindPlanningSucceededCallback (PlannerCallback callback)
 
void BindPartialPlanFoundCallback (PlannerCallback callback)
 
void BindPlanningFailedCallback (std::function< void(const planning::Goal &)> callback)
 
void BindPlanExecutedCallback (std::function< void()> callback)
 
void SetSnapshotProduction (bool shouldProduce)
 
bool IsComputing () const
 
PlannerReasonerSnapshot ProduceDebugSnapshot ()
 
virtual std::unique_ptr< ISnapshotGeneratorCreateSnapshotGenerator (std::size_t) override
 
void ClearCurrentDebugSnapshot ()
 
void SetDebugSnapshotFirstIteration (std::size_t iterationNumber)
 
void SetDebugSnapshotLastIteration (std::size_t iterationNumber)
 
std::size_t GetDebugSnapshotFirstIteration () const
 
std::size_t GetDebugSnapshotLastIteration () const
 
- Public Member Functions inherited from grail::Reasoner
 Reasoner (const Reasoner &)=default
 
 Reasoner (Reasoner &&)=default
 
Reasoneroperator= (const Reasoner &)=default
 
Reasoneroperator= (Reasoner &&)=default
 
virtual std::unique_ptr< ISnapshotGeneratorCreateSnapshotGenerator (size_t)
 

Detailed Description

A reasoner which uses planners to find optimal sequences of behaviors based on goals.

Member Function Documentation

◆ SelectBehavior()

void grail::PlannerReasoner::SelectBehavior ( AIEntity entity)
overridevirtual

selectBehavior - Runs reasoner's selection algorithm and assigns chosen behavior to provided entity.

Parameters
entity

Implements grail::Reasoner.

◆ SetupNewPlanner()

void grail::PlannerReasoner::SetupNewPlanner ( std::unique_ptr< planning::DomainTranslator domainTranslator,
const Config config 
)

Resets the planner domain. based on data provided by the new domain translator . This method can be used if you want the agent to start planning an entirely different set of actions and disregard the previously defined domain.


The documentation for this class was generated from the following files: