(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
SimulatedGameHelper.h
1 #ifndef GRAIL_SIMULATED_GAME_HELPER_H
2 #define GRAIL_SIMULATED_GAME_HELPER_H
3 
4 #include <vector>
5 #include <memory>
6 #include "SimulatedGameRuntime.hh"
7 
8 namespace grail
9 {
10  namespace simulation
11  {
12  class SimulatedGameNode;
13  class SimulatedGameObserverForGUI;
14 
15  //This class should not be visible to developers at all
17  {
19  void SetTeamCount(int teamCount);
20  void SetExplorationRatio(double exploratioRatio);
21  void SetFreezeVisitsTreshold(size_t treshold);
22 
24  void Reset();
25 
27  void ApplyActions() const;
28  void ApplyActionsWithDebug(SimulatedGameObserverForGUI& observer) const;
29  void Backpropagation();
30 
32  void BackpropagationWithTerminal(std::vector<float>& scores);
33 
34  double explorationConstant;
35  size_t freezeVisitsTreshold;
36  std::vector<SimulatedGameNode*> visitedNodes;
37  std::vector<size_t> actionIndicesHistory;
38  std::unique_ptr<SimulatedGameRuntime> runtimeControl;
39 
40  friend class SimulatedGameObserverForGUI;
41  };
42  }
43 }
44 #endif //GRAIL_SIMULATED_GAME_HELPER_H
Definition: SimulatedGameObserverForGUI.h:22
Definition: SimulatedGameHelper.h:17
void ApplyActions() const
Applies deferred actions (to be called when the process falls out of the tree and Monte Carlo phase i...
Definition: SimulatedGameHelper.cpp:37
void BackpropagationWithTerminal(std::vector< float > &scores)
This is backpropagation that checks whether a state is terminal.
Definition: SimulatedGameHelper.cpp:62
void Reset()
Resets to a state adequate to the start of a new simulation.
Definition: SimulatedGameHelper.cpp:30