(C++)  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 >
SelectorResult< ContextType > SelectMaxUtility (const std::vector< std::pair< ContextType, std::shared_ptr< IEvaluator< ContextType >>> > &options, std::function< bool(const std::size_t &)> validator)
 
template<typename ContextType >
SelectorResult< ContextType > GetBestOption (SelectionMethod selectionMethod, const std::vector< std::pair< ContextType, std::shared_ptr< IEvaluator< ContextType >>> > &options, 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

template<typename ContextType >
SelectorResult<ContextType> grail::utility::selector::GetBestOption ( SelectionMethod  selectionMethod,
const std::vector< std::pair< ContextType, std::shared_ptr< IEvaluator< ContextType >>> > &  options,
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
validator- function validating whether given option can be chosen
Returns
struct containing selected option data