The reasoner that encalpsulates the SimulatedGame technique which is based on Monte Carlo Tree Search.
More...
The reasoner that encalpsulates the SimulatedGame technique which is based on Monte Carlo Tree Search.
◆ SimulatedGameReasoner()
Constructs a new SimulatedGameReasoner
- Parameters
-
| gameStateTranslator | Object that instantiates SimulatedGame based on the current state of the actual game |
| actionTranslator | Object that translates actions from SimulatedGame (the result) onto plan consisting of behaviors in the actual game |
| iterationsPerFrame | The maximum number of iterations (simulations) per one game frame |
| maxIterations | The number of iterations to be performed before getting results - translating actions onto behaviors. This tells the reasoner "think for maxIterations before making decisions" |
| maxRecalculationIterations | When you call the RequestRecalculation function, the reasoner will use this pool of additional iterations. |
◆ ClearCache()
| override void Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.ClearCache |
( |
| ) |
|
|
inlinevirtual |
Called when assigning this reasoner to an entity. Clears internally stored data, which may be invalidated when assigned to a different entity. THIS METHOD SHOULD NOT BE CALLED BY THE USER. IT IS PUBLIC SO THAT THIS METHOD CAN BE USED BY ENTITY AND OVERRIDEN IN DIFFERENT MODULE
Reimplemented from Grail.Core.Reasoner.
◆ ProduceDebugSnapshot()
◆ RequestRecalculation()
| void Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.RequestRecalculation |
( |
AIEntity |
entity | ) |
|
|
inline |
As documented, the ISimulatedActionTranslator translates the actions computed by SimulatedGame to behaviors. It constructs a plan (of such behaviors). Call this method at anytime if you want to stop applying behaviors (it will terminate the current one and clear all future ones). This should be called when the state desynchronizes, so the future plan should be invalidated. The method will make the reasoner perform additional simulations if computational budget allows for it.
◆ SetSnapshotProduction()
| void Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.SetSnapshotProduction |
( |
bool |
shouldProduceData | ) |
|
|
inline |
Calling this function makes the reasoner collect debug data. The GrailDebugger will call it automatically.
- Parameters
-
◆ StageBehavior()
| override void Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.StageBehavior |
( |
AIEntity |
entity | ) |
|
|
inlinevirtual |
Runs reasoner's selection algorithm and assigns chosen behavior to provided entity.
- Parameters
-
Implements Grail.Core.Reasoner.
◆ FallbackBehavior
| Behavior Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.FallbackBehavior |
|
set |
◆ Game
| SimulatedGame Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.Game |
|
get |
◆ IsComputing
| bool Grail.SimulatedGames.Reasoners.SimulatedGameReasoner.IsComputing |
|
get |
Returns true is the reasoner has not finished computations (i.e. there are still simulations to perform).
The documentation for this class was generated from the following file:
- GrailSimulatedGames/source/Reasoners/SimulatedGameReasoner.cs