Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planner::Goal Class Referenceabstract

#include <Goal.hh>

Public Member Functions

 Goal (const Goal &)=default
 
 Goal (Goal &&)=default
 
Goaloperator= (const Goal &)=default
 
Goaloperator= (Goal &&)=default
 
virtual void OnChosen (const AIEntity &goalPursuer)
 
virtual void OnReached (const AIEntity &goalPursuer) const
 
virtual void OnReapplied (const AIEntity &goalPursuer)
 
virtual bool IsReached (const AIEntity &entity) const =0
 
virtual void SetPlanSpaceConditions (class Planner &planner, const ObjectIndexBinding &objectIndexBinding) const =0
 
virtual PlannerHeuristic GetHeuristic () const
 

Detailed Description

Represents a planner goal, used by PlannerReasoner. A single planning problem may have multiple Goals defined.

Member Function Documentation

◆ GetHeuristic()

PlannerHeuristic grail::planner::Goal::GetHeuristic ( ) const
virtual
Returns
the heuristic used to make the planning algorithm more efficient. For more information, consult the planner's documentation.

◆ IsReached()

virtual bool grail::planner::Goal::IsReached ( const AIEntity entity) const
pure virtual

Determines if the goal has been satisfied for the provided AIEntity.

Parameters
entity- the AIEntity object to test the achievement of the goal for.
Returns
true if the goal has been reached and false otherwise.

◆ OnChosen()

void grail::planner::Goal::OnChosen ( const AIEntity goalPursuer)
virtual

Called after the Goal is set by the reasoner. Put your custom logic, if needed. Te base implementation is empty.

Parameters
goalPursuer- the entity that has chosen this goal

◆ OnReached()

void grail::planner::Goal::OnReached ( const AIEntity goalPursuer) const
virtual

Called by the PlannerReasoner after Goal::IsReached method returns true

Parameters
goalPursuer- the entity that has chosen this goal

◆ OnReapplied()

void grail::planner::Goal::OnReapplied ( const AIEntity goalPursuer)
virtual

Called if the current plan failed to achieve this goal but it got chosen once again

Parameters
goalPursuer- the entity that has chosen this goal

◆ SetPlanSpaceConditions()

virtual void grail::planner::Goal::SetPlanSpaceConditions ( class Planner planner,
const ObjectIndexBinding objectIndexBinding 
) const
pure virtual

In this method, all plan-space goal conditions should be set.

Parameters
planner- the planner to be provided with goal conditions. Use Planner::pushCondition method.

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