(C++)  1.1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
C45ValueDecisionCounter.h
1 #ifndef GRAIL_C45_VALUE_DECISION_COUNTER_H
2 #define GRAIL_C45_VALUE_DECISION_COUNTER_H
3 
4 #include "C45GameActionCounter.h"
5 #include <unordered_map>
6 
7 namespace grail
8 {
9  namespace simulation
10  {
11  class ISimulatedGameAction;
12 
15  {
16  public:
17 
18  const std::unordered_map<float, int>& getSampleCountByKey() const;
19 
20  void clear();
21 
22  double getTotalSampleCount() const;
23 
24  size_t geKeyCount() const;
25 
26  void observeKey(float key);
27 
28  void observeKeyDecision(float key, ISimulatedGameAction* decision);
29 
30  double calculateEntropy() const;
31 
32  int getCount(float key) const;
33 
34  double calculateGainPortion(double globalEntropy);
35 
36  private:
37  std::unordered_map<float, int> sampleCountByKey;
38  std::unordered_map<float, C45GameActionCounter> decisionCounterByKey;
39  double totalSamples = 0;
40  };
41  }
42 }
43 
44 #endif //GRAIL_C45_VALUE_DECISION_COUNTER_H
The whole class should be INTERNAL; part of the private interface.
Definition: C45ValueDecisionCounter.h:15
Base class for all actions in SimulatedGame. Derive from it for your actions.
Definition: ISimulatedGameAction.hh:41