Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
SimulatedGameRuntime.hh
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_SIMULATED_GAME_RUNTIME_H
4 #define GRAIL_SIMULATED_GAME_RUNTIME_H
5 
6 #include <vector>
7 
8 namespace grail
9 {
10 namespace simgames
11 {
18  {
19  public:
20  SimulatedGameRuntime(int teamCount);
21 
25  float GetScore(int player) const;
26 
30  void SetScore(int player, float score);
31 
35  bool IsTerminationRequest() const;
36 
40  void SetTerminationRequest();
41 
42  private:
43  void reset();
44 
45  std::vector<double> scores{};
46  int currentStep = 0;
47  bool terminationRequest = false;
48 
49  friend struct SimulatedGameHelper;
50  friend class SimulatedGame;
51  friend class SimulatedGameNode;
52  };
53 }
54 }
55 #endif //GRAIL_SIMULATED_GAME_RUNTIME_H
grail::simgames::SimulatedGameRuntime::GetScore
float GetScore(int player) const
Gets the score value set for a given player.
Definition: SimulatedGameRuntime.cpp:10
grail::simgames::SimulatedGameRuntime
An interface that is used to terminate simulation in MCTS and set scores to players....
Definition: SimulatedGameRuntime.hh:17
grail::simgames::SimulatedGameRuntime::SetTerminationRequest
void SetTerminationRequest()
Call this function to indicate that the game has ended, i.e. the terminal conditions have been met.
Definition: SimulatedGameRuntime.cpp:25
grail::simgames::SimulatedGameHelper
Definition: SimulatedGameHelper.h:18
grail::simgames::SimulatedGame
The main interface class for the SimulatedGame reasoner based on the MCTS algorithm....
Definition: SimulatedGame.hh:30
grail::simgames::SimulatedGameRuntime::SetScore
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:15
grail::simgames::SimulatedGameRuntime::IsTerminationRequest
bool IsTerminationRequest() const
Checks whether the terminationProperty has been set by calling the corresponding setTerminationReques...
Definition: SimulatedGameRuntime.cpp:20
grail::simgames::SimulatedGameNode
This class should not be visible to developers at all.
Definition: SimulatedGameNode.hh:25