Grail (C++)  1.1.1
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 <memory>
5 #include <vector>
6 #include "SimulatedGameRuntime.hh"
7 
8 namespace grail
9 {
10  namespace simulation
11  {
12  class SimulatedGameNode;
13  class SimulatedGameSnapshotObserver;
14 
15  //This class should not be visible to developers at all
17  {
19  void SetTeamCount(int teamCount);
20  void SetExplorationRatio(double explorationRatio);
21  void SetFreezeVisitsTreshold(size_t treshold);
22 
24  void Reset();
25 
27  void ApplyActions() const;
28  void ApplyActionsWithDebug(SimulatedGameSnapshotObserver& 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 SimulatedGameSnapshotObserver;
41  };
42  }
43 }
44 #endif //GRAIL_SIMULATED_GAME_HELPER_H
grail::simulation::SimulatedGameHelper::Reset
void Reset()
Resets to a state adequate to the start of a new simulation.
Definition: SimulatedGameHelper.cpp:29
grail::simulation::SimulatedGameHelper::ApplyActions
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:36
grail::simulation::SimulatedGameHelper
Definition: SimulatedGameHelper.h:16
grail::simulation::SimulatedGameSnapshotObserver
Definition: SimulatedGameSnapshotObserver.h:21
grail::simulation::SimulatedGameHelper::BackpropagationWithTerminal
void BackpropagationWithTerminal(std::vector< float > &scores)
This is backpropagation that checks whether a state is terminal.
Definition: SimulatedGameHelper.cpp:62