Base class of a unit in the SimulatedGame framework. A unit represents part of the game-state and peforms actions that affect the game-state. You should not create instances of this class. Use specializations @SimulatedGameThinkingUnit or @SimulatedGameStochasticUnit instead.
More...
Base class of a unit in the SimulatedGame framework. A unit represents part of the game-state and peforms actions that affect the game-state. You should not create instances of this class. Use specializations @SimulatedGameThinkingUnit or @SimulatedGameStochasticUnit instead.
◆ AfterAction()
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.
◆ FillDebugRepresentation()
virtual void Grail.Simulation.ISimulatedGameUnit.FillDebugRepresentation |
( |
Dictionary< string, string > |
nameValueDictionary | ) |
|
|
inlinevirtual |
Method used to gather data for GUI-based debugging. Insert properties of the state (key, value) you wish to view in the debugging tool.
- Parameters
-
◆ GetAvailableActions()
Returns the actions the unit may perform. This method must always return the same set of actions in the same state. You can reuse ISimulatedGameAction objects, but create a new list before returning.
◆ GetRandomAvailableAction()
virtual ISimulatedGameAction Grail.Simulation.ISimulatedGameUnit.GetRandomAvailableAction |
( |
Random |
random | ) |
|
|
inlinevirtual |
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.
- Parameters
-
- Returns
◆ Reset()
abstract void Grail.Simulation.ISimulatedGameUnit.Reset |
( |
| ) |
|
|
pure virtual |
◆ HeuristicReasoners
Add or remove heuristic. See @SimulatedGameHeuristic. Heuristic is used to provide the action to play in certain moments without considering all the options.
◆ TeamIndex
abstract uint Grail.Simulation.ISimulatedGameUnit.TeamIndex |
|
get |
Returns the index of a team. Units with the same team index share the same game score.
The documentation for this class was generated from the following file:
- GrailSimulatedGames/source/SimulatedGames/Core/ISimulatedGameUnit.cs