Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
RouletteUtilityReasoner.hh
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_ROULETTE_UTILITY_REASONER_H
4 #define GRAIL_ROULETTE_UTILITY_REASONER_H
5 
6 #include "UtilityReasoner.hh"
7 #include "../ConfigHelpers/RandomNumberGenerator.h"
8 #include "../Selectors/RouletteSelector.hh"
9 
10 #include <functional>
11 
12 namespace grail
13 {
14 namespace utility
15 {
17  {
18  public:
26  std::shared_ptr<RandomNumberGenerator> randomNumberGenerator,
27  roulette_selector::RouletteOptions rouletteOptions,
28  float persistence = 0.1f);
29 
36  std::shared_ptr<RandomNumberGenerator> randomNumberGenerator,
37  float persistence = 0.1f);
38 
45  roulette_selector::RouletteOptions rouletteOptions,
46  float persistence = 0.1f);
47 
53  float persistence = 0.1f);
54 
55  RouletteUtilityReasoner(const RouletteUtilityReasoner& other) = delete;
57 
61 
62  protected:
68  void GetBestOption(const std::vector<SelectionOption<EntityBlackboardPair>>& options,
69  SelectionResult& result,
70  std::function<bool(const std::size_t&)> validator) override;
71 
72  private:
73  std::shared_ptr<RandomNumberGenerator> randomNumberGenerator;
74  roulette_selector::RouletteOptions rouletteOptions;
75  };
76 }
77 }
78 
79 #endif //GRAIL_ROULETTE_UTILITY_REASONER_H
grail::utility::RouletteUtilityReasoner::RouletteUtilityReasoner
RouletteUtilityReasoner(std::vector< BlueprintOption< Behavior, EntityBlackboardPair, grail::AIEntity >> blueprintOptions, std::shared_ptr< RandomNumberGenerator > randomNumberGenerator, roulette_selector::RouletteOptions rouletteOptions, float persistence=0.1f)
UtilityReasoner - Constructor.
Definition: RouletteUtilityReasoner.cpp:12
grail::utility::roulette_selector::RouletteOptions
RouletteSelectionOptions - Struct determining options for roulette selection.
Definition: RouletteOptions.hh:18
grail::utility::BlueprintOption
Definition: BlueprintOption.hh:14
grail::utility::SelectionOption< EntityBlackboardPair >
grail::utility::SelectionResult
The SelectionResult struct - Structure containing results of operations done by Selector.
Definition: SelectionResult.hh:19
grail::utility::UtilityReasoner
The UtilityReasoner class - Class responsible for assigning behaviors using Utility System algorithm....
Definition: UtilityReasoner.hh:24
grail::utility::RouletteUtilityReasoner
Definition: RouletteUtilityReasoner.hh:16
grail::utility::RouletteUtilityReasoner::GetBestOption
void GetBestOption(const std::vector< SelectionOption< EntityBlackboardPair >> &options, SelectionResult &result, std::function< bool(const std::size_t &)> validator) override
GetBestOption - Selects most suitable option. Provides different context for each evaluated objects.
Definition: RouletteUtilityReasoner.cpp:44
grail::utility::RouletteUtilityReasoner::SetRouletteOptions
void SetRouletteOptions(roulette_selector::RouletteOptions rouletteOptions)
SetRouletteOptions - Sets new roulette options.