Grail (C++)  1.3.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
SimulatedGameStochasticUnit.hh
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
4 #define GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
5 
6 #include <memory>
7 #include <vector>
8 #include "ISimulatedGameAction.hh"
9 #include "ISimulatedGameUnit.hh"
10 
11 namespace grail
12 {
13 namespace simgames
14 {
15  class SimulatedGameRuntime;
16 
24  {
25  public:
29  virtual int GetTeamIndex() const override;
30 
39  virtual size_t GetRandomActionIndex(std::vector<std::unique_ptr<const ISimulatedGameAction>>& actions,
40  RandomGenerator& rand_gen) const;
41 
42  private:
43  virtual bool IsStochastic() const override final;
44 
45  virtual void ObserveNode(const SimulatedGameNode&) override final;
46 
47  friend class SimulatedGame;
48  };
49 }
50 }
51 #endif //GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
grail::simgames::SimulatedGameStochasticUnit::GetTeamIndex
virtual int GetTeamIndex() const override
TeamIndex is relevant for SimulatedGameStochasticUnit only for GUI purposes (to show it as a separate...
Definition: SimulatedGameStochasticUnit.cpp:9
grail::simgames::SimulatedGameStochasticUnit
A base class of a unit in SimulatedGame that peforms actions according to some probability distributi...
Definition: SimulatedGameStochasticUnit.hh:23
grail::simgames::SimulatedGame
The main interface class for the SimulatedGame reasoner based on the MCTS algorithm....
Definition: SimulatedGame.hh:30
grail::simgames::ISimulatedGameUnit
Base class of a unit in the SimulatedGame framework. A unit represents part of the game-state and pef...
Definition: ISimulatedGameUnit.hh:28
grail::simgames::SimulatedGameNode
This class should not be visible to developers at all.
Definition: SimulatedGameNode.hh:25
grail::simgames::SimulatedGameStochasticUnit::GetRandomActionIndex
virtual size_t GetRandomActionIndex(std::vector< std::unique_ptr< const ISimulatedGameAction >> &actions, RandomGenerator &rand_gen) const
This function returns index of the action (rather than the action itself) chosen according to the uni...
Definition: SimulatedGameStochasticUnit.cpp:14