 |
Grail (C++)
1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
1 #ifndef GRAIL_SIMULATED_GAME_UNIT
2 #define GRAIL_SIMULATED_GAME_UNIT
10 #include "ISimulatedGameAction.hh"
11 #include "ISimulatedGameHeuristic.hh"
15 using RandomGenerator = std::mt19937_64;
19 class SimulatedGameNode;
34 virtual void Reset() = 0;
45 virtual std::vector<std::unique_ptr<const ISimulatedGameAction>>
GetAvailableActions()
const = 0;
55 RandomGenerator& rand_gen)
const;
66 virtual std::string
ToString()
const;
83 virtual bool IsStochastic()
const = 0;
90 #endif //GRAIL_SIMULATED_GAME_UNIT
virtual std::string ToString() const
Returns the text representation of the unit for debugging purposes. Default implementation returns an...
Definition: ISimulatedGameUnit.cpp:14
virtual void FillDebugRepresentation(std::map< std::string, std::string > &nameValueDictionary) const
Method used to gather data for GUI-based debugging. Insert properties of the state (key,...
Definition: ISimulatedGameUnit.cpp:19
virtual void Reset()=0
Resets state of the unit to the beginning of the SimulatedGame.
std::vector< std::unique_ptr< SimulatedGameHeuristic > > heuristicReasoners
Add or remove heuristic. See @SimulatedGameHeuristic. Heuristic is used to provide the action to play...
Definition: ISimulatedGameUnit.hh:77
This class should not be visible to developers at all.
Definition: SimulatedGameNode.h:23
virtual std::unique_ptr< const ISimulatedGameAction > GetRandomAvailableAction(RandomGenerator &rand_gen) const
Returns a random action to be chosen in simulation. The default implementation samples from GetAvaila...
Definition: ISimulatedGameUnit.cpp:4
The main interface class for the SimulatedGame reasoner based on the MCTS algorithm....
Definition: SimulatedGame.hh:28
virtual int GetTeamIndex() const =0
Returns the index of a team. Units with the same team index share the same game score.
An interface that is used to terminate simulation in MCTS and set scores to players....
Definition: SimulatedGameRuntime.hh:15
virtual std::vector< std::unique_ptr< const ISimulatedGameAction > > GetAvailableActions() const =0
Returns the actions the unit may perform.
virtual void AfterAction(SimulatedGameRuntime &)
This method is called after action.Apply(). You may insert custom logic here - for example - code tha...
Definition: ISimulatedGameUnit.cpp:10
Base class of a unit in the SimulatedGame framework. A unit represents part of the game-state and pef...
Definition: ISimulatedGameUnit.hh:26