Grail (C++)  1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::simulation::SimulatedGameThinkingUnit Class Reference

A base class of a unit related to a rational/intelligent player. MCTS chooses actions for this kind of unit. See also SimulatedGameStochasticUnit. All units together represent the game state. More...

#include <SimulatedGameThinkingUnit.hh>

Inheritance diagram for grail::simulation::SimulatedGameThinkingUnit:
Collaboration diagram for grail::simulation::SimulatedGameThinkingUnit:

Public Member Functions

virtual bool IsStochastic () const override final
 For grail-internal use only.
 
- Public Member Functions inherited from grail::simulation::ISimulatedGameUnit
virtual void Reset ()=0
 Resets state of the unit to the beginning of the SimulatedGame. More...
 
virtual int GetTeamIndex () const =0
 Returns the index of a team. Units with the same team index share the same game score. More...
 
virtual std::vector< std::unique_ptr< const ISimulatedGameAction > > GetAvailableActions () const =0
 Returns the actions the unit may perform.
More...
 
virtual std::unique_ptr< const ISimulatedGameActionGetRandomAvailableAction (RandomGenerator &rand_gen) const
 Returns a random action to be chosen in simulation. The default implementation samples from GetAvailableActions(). Override the method if you are able to return a uniform random action without the need of computing all available actions. More...
 
virtual void AfterAction (SimulatedGameRuntime &)
 This method is called after action.Apply(). You may insert custom logic here - for example - code that always needs to be executed after any action. More...
 
virtual std::string ToString () const
 Returns the text representation of the unit for debugging purposes. Default implementation returns an empty string. More...
 
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, value) you wish to view in the debugging tool. More...
 

Public Attributes

std::vector< std::shared_ptr< OfflineLearner > > OfflineLearners = {}
 Add or remove objects for OfflineLearning. See @OfflineLerner and Offline Learning in SimulatedGames.
 
- Public Attributes inherited from grail::simulation::ISimulatedGameUnit
std::vector< std::unique_ptr< SimulatedGameHeuristic > > heuristicReasoners
 Add or remove heuristic. See @SimulatedGameHeuristic. Heuristic is used to provide the action to play in certain moments without considering all the options. More...
 

Friends

class SimulatedGame
 

Detailed Description

A base class of a unit related to a rational/intelligent player. MCTS chooses actions for this kind of unit. See also SimulatedGameStochasticUnit. All units together represent the game state.


The documentation for this class was generated from the following files: