Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::utility::max_selector Namespace Reference

The max selector namespace - contains method responsible for selecting most suitable objects based on calculated scores. More...

Functions

template<typename ContextType >
void GetBestOption (const std::vector< SelectionOption< ContextType >> &options, SelectionResult &result, std::function< bool(const std::size_t &)> validator)
 GetBestOption - Selects most suitable option. Provides different context for each evaluated objects. More...
 

Detailed Description

The max selector namespace - contains method responsible for selecting most suitable objects based on calculated scores.

Function Documentation

◆ GetBestOption()

template<typename ContextType >
void grail::utility::max_selector::GetBestOption ( const std::vector< SelectionOption< ContextType >> &  options,
SelectionResult result,
std::function< bool(const std::size_t &)>  validator 
)

GetBestOption - Selects most suitable option. Provides different context for each evaluated objects.

Parameters
options- Contexts paired with evaluators
result- Reference to the selection result object.
validator- Function validating whether given object can be chosen
Template Parameters
ContextType- Type of evaluated object. By default - ValueTuple(AIEntity, Blackboard).