A base class of a unit in SimulatedGame that peforms actions according to some probability distribution. It does not represents any players in the game. It should be used if either (1) randomness affects actions available to other players (2) randomness heavily affects the game outcome. Random effects should be applied as actions of SimulatedGameStochasticUnit.
More...
|
virtual int | GetRandomActionIndex (in IEnumerable< ISimulatedGameAction > actions, Random random) |
| This function returns index of the action (rather than the action itself) chosen according to the unit's logic. The default implementation assumes the uniform random distribution (each action chosen with equal probability). Override it if actions have different chances to be chosen. More...
|
|
abstract void | Reset () |
| Resets state of the unit to the beginning of the SimulatedGame. More...
|
|
abstract List< ISimulatedGameAction > | 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. More...
|
|
virtual ISimulatedGameAction | GetRandomAvailableAction (Random random) |
| 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 (in SimulatedGameRuntime gameRuntime) |
| 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 void | FillDebugRepresentation (Dictionary< string, string > nameValueDictionary) |
| 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...
|
|
A base class of a unit in SimulatedGame that peforms actions according to some probability distribution. It does not represents any players in the game. It should be used if either (1) randomness affects actions available to other players (2) randomness heavily affects the game outcome. Random effects should be applied as actions of SimulatedGameStochasticUnit.
◆ GetRandomActionIndex()
virtual int Grail.Simulation.SimulatedGameStochasticUnit.GetRandomActionIndex |
( |
in IEnumerable< ISimulatedGameAction > |
actions, |
|
|
Random |
random |
|
) |
| |
|
inlinevirtual |
This function returns index of the action (rather than the action itself) chosen according to the unit's logic. The default implementation assumes the uniform random distribution (each action chosen with equal probability). Override it if actions have different chances to be chosen.
- Parameters
-
actions | The collection of available actions that is cached for the unit. |
random | C# random generation object |
- Returns
- Index of the chosen action. This value cannot be greater than the size of @actions collection.
◆ TeamIndex
override uint Grail.Simulation.SimulatedGameStochasticUnit.TeamIndex |
|
get |
The documentation for this class was generated from the following file:
- GrailSimulatedGames/source/SimulatedGames/Core/SimulatedGameStochasticUnit.cs