(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
SimulatedGameRuntime.hh
1 #ifndef GRAIL_SIMULATED_GAME_RUNTIME_H
2 #define GRAIL_SIMULATED_GAME_RUNTIME_H
3 
4 #include <vector>
5 
6 namespace grail
7 {
8  namespace simulation
9  {
16  {
17  public:
18  SimulatedGameRuntime(int teamCount);
19 
21  float GetScore(int player) const;
22 
24  void SetScore(int player, float score);
25 
27  bool IsTerminationRequest() const;
28 
30  void SetTerminationRequest();
31 
32  private:
33  void reset();
34 
35  std::vector<float> scores{};
36  int currentStep = 0;
37  bool terminationRequest = false;
38 
39  friend struct SimulatedGameHelper;
40  friend class SimulatedGame;
41  friend class SimulatedGameNode;
42  };
43  }
44 }
45 #endif //GRAIL_SIMULATED_GAME_RUNTIME_H
The main interface class for the SimulatedGame reasoner based on the MCTS algorithm....
Definition: SimulatedGame.hh:29
This class should not be visible to developers at all.
Definition: SimulatedGameNode.h:24
An interface that is used to terminate simulation in MCTS and set scores to players....
Definition: SimulatedGameRuntime.hh:16
float GetScore(int player) const
Gets the score value set for a given player.
Definition: SimulatedGameRuntime.cpp:8
void SetScore(int player, float score)
Sets value in the array of scores indexed by teams. See @teamCount in SimulatedGame constructor or @t...
Definition: SimulatedGameRuntime.cpp:13
void SetTerminationRequest()
Call this function to indicate that the game has ended, i.e. the terminal conditions have been met.
Definition: SimulatedGameRuntime.cpp:23
bool IsTerminationRequest() const
Checks whether the terminationProperty has been set by calling the corresponding setTerminationReques...
Definition: SimulatedGameRuntime.cpp:18
Definition: SimulatedGameHelper.h:17