1 #ifndef GRAIL_SIMULATED_GAME_NODE_H
2 #define GRAIL_SIMULATED_GAME_NODE_H
4 #include "ISimulatedGameAction.hh"
5 #include "SimulatedGameActionMetadata.hh"
9 #include <unordered_map>
11 typedef std::mt19937_64 RandomGenerator;
17 class SimulatedGameThinkingUnit;
18 class ISimulatedGameUnit;
19 class SimulatedGameObserverForGUI;
20 struct SimulatedGameHelper;
29 void Backpropagate(
float score);
40 std::vector<SimulatedGameActionMetadata> GetActionsWithMetadata()
const;
41 void FillPlan(std::unordered_map<
const ISimulatedGameUnit*, std::vector<const ISimulatedGameAction*>>& plan,
int teamIndex)
const;
42 void FillPlanWithMetadata(std::unordered_map<
const ISimulatedGameUnit*, std::vector<SimulatedGameActionMetadata>>& plan,
int teamIndex)
const;
43 void FillPath(std::vector<std::pair<const ISimulatedGameUnit*, const ISimulatedGameAction*>>& path)
const;
48 double GetVisits()
const;
50 std::vector<std::unique_ptr<SimulatedGameNode>> children{};
52 bool IsTerminal()
const;
54 size_t GetBestActionIndex()
const;
57 double totalScore = 0.0;
59 std::vector<std::unique_ptr<const ISimulatedGameAction>> actions{};
60 std::vector<float> terminalScores{};
Base class for all actions in SimulatedGame. Derive from it for your actions.
Definition: ISimulatedGameAction.hh:41
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
Definition: SimulatedGameObserverForGUI.h:22
An interface that is used to terminate simulation in MCTS and set scores to players....
Definition: SimulatedGameRuntime.hh:16
Definition: SimulatedGameHelper.h:17