The reasoner that encalpsulates the SimulatedGame technique which is based on Monte Carlo Tree Search.
More...
|
| SimulatedGameReasoner (in ISimulatedGameStateTranslator gameStateTranslator, in ISimulatedActionTranslator actionTranslator, uint iterationsPerFrame, uint maxIterations=1000, uint maxRecalculationIterations=1000) |
| Constructs a new SimulatedGameReasoner More...
|
|
void | RequestRecalculation (AIEntity entity) |
| 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. More...
|
|
void | SetSnapshotProduction (bool shouldProduceData) |
| Calling this function makes the reasoner collect debug data. The GrailDebugger will call it automatically. More...
|
|
override void | SelectBehavior (AIEntity entity) |
| Runs reasoner's selection algorithm and assigns chosen behavior to provided entity. More...
|
|
SimulatedGamesReasonerSnapshot | ProduceDebugSnapshot () |
| This method returns debug snapshot of data collected so far by SimulatedGameObserverForGUI. The GrailDebugger will call it. More...
|
|
override ISnapshotGenerator | CreateSnapshotGenerator (int entityId) |
|
void | ClearDebugData () |
|
|
SimulatedGame | Game [get] |
| Gets the SimulatedGame object that is currently created by the ISimulatedGameStateTranslator. More...
|
|
Behavior | FallbackBehavior [set] |
| Set a fallback behavior if no valid behaviors are produced from actions returned by SimulatedGame. Please note that ISimulatedActionTranslator translates actions onto behaviors. More...
|
|
bool | IsComputing = false [get] |
| Returns true is the reasoner has not finished computations (i.e. there are still simulations to perform). More...
|
|
uint? | DebugSnapshotFirstIteration [get, set] |
| You may limit the number of debug data collected to only data produced by simulations with numbers between [First, Last]. This method gets or sets the @First limit.
|
|
uint? | DebugSnapshotLastIteration [get, set] |
| You may limit the number of debug data collected to only data produced by simulations with numbers between [First, Last]. This method gets or sets the @Last limit.
|
|
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. |
◆ ProduceDebugSnapshot()
This method returns debug snapshot of data collected so far by SimulatedGameObserverForGUI. The GrailDebugger will call it.
- Returns
◆ RequestRecalculation()
void Grail.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.
◆ SelectBehavior()
override void Grail.SimulatedGameReasoner.SelectBehavior |
( |
AIEntity |
entity | ) |
|
|
inlinevirtual |
Runs reasoner's selection algorithm and assigns chosen behavior to provided entity.
- Parameters
-
Implements Grail.Reasoner.
◆ SetSnapshotProduction()
void Grail.SimulatedGameReasoner.SetSnapshotProduction |
( |
bool |
shouldProduceData | ) |
|
|
inline |
Calling this function makes the reasoner collect debug data. The GrailDebugger will call it automatically.
- Parameters
-
◆ FallbackBehavior
Behavior Grail.SimulatedGameReasoner.FallbackBehavior |
|
set |
Set a fallback behavior if no valid behaviors are produced from actions returned by SimulatedGame. Please note that ISimulatedActionTranslator translates actions onto behaviors.
◆ Game
Gets the SimulatedGame object that is currently created by the ISimulatedGameStateTranslator.
◆ IsComputing
bool Grail.SimulatedGameReasoner.IsComputing = false |
|
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