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

The UtilitySelector namespace - contains methods responsible for selecting most suitable objects based on calculated scores. More...

Functions

template<typename ContextType >
void SelectMaxUtility (const std::vector< Option< ContextType >> &options, SelectionResult &result, std::function< bool(const std::size_t &)> validator)
 
template<typename ContextType >
void GetBestOption (SelectionMethod selectionMethod, const std::vector< Option< ContextType >> &options, SelectionResult &result, std::function< bool(const std::size_t &)> validator=[](const std::size_t &) -> bool { return true;})
 GetBestOption - Selects most suitable option. Provides different context for each evaluated objects. More...
 

Detailed Description

The UtilitySelector namespace - contains methods responsible for selecting most suitable objects based on calculated scores.

Function Documentation

◆ GetBestOption()

template<typename ContextType >
void grail::utility::selector::GetBestOption ( SelectionMethod  selectionMethod,
const std::vector< Option< ContextType >> &  options,
SelectionResult result,
std::function< bool(const std::size_t &)>  validator = [](const std::size_t&) -> bool { return true; } 
)

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

Parameters
selectionMethod- MAX or ROULETTE (ROULETTE not yet implemented)
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).