(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
SimulatedGameStochasticUnit.hh
1 #ifndef GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
2 #define GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
3 
4 #include "ISimulatedGameUnit.hh"
5 #include "ISimulatedGameAction.hh"
6 #include <vector>
7 #include <memory>
8 
9 namespace grail
10 {
11  namespace simulation
12  {
13  class SimulatedGameRuntime;
14 
22  {
23  public:
24 
28  virtual int GetTeamIndex() const;
29 
38  virtual size_t GetRandomActionIndex(std::vector<std::unique_ptr<const ISimulatedGameAction>>& actions, RandomGenerator& rand_gen) const;
39 
40  private:
41  bool IsStochastic() const final;
42 
43  void ObserveNode(const SimulatedGameNode*) final;
44 
45  friend class SimulatedGame;
46  };
47  }
48 }
49 #endif //GRAIL_SIMULATED_GAME_STOCHASTIC_UNIT_H
Base class of a unit in the SimulatedGame framework. A unit represents part of the game-state and pef...
Definition: ISimulatedGameUnit.hh:27
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
A base class of a unit in SimulatedGame that peforms actions according to some probability distributi...
Definition: SimulatedGameStochasticUnit.hh:22
virtual int GetTeamIndex() const
TeamIndex is relevant for SimulatedGameStochasticUnit only for GUI purposes (to show it as a separate...
Definition: SimulatedGameStochasticUnit.cpp:7
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:12