Utilty AI for Unity
 All Classes Namespaces Functions Variables Events Pages
Public Member Functions | Protected Member Functions | List of all members
TenPN.DecisionFlex.SelectWeightedRandom Class Reference

Choose a good action but not always the best, using weights. More...

Inheritance diagram for TenPN.DecisionFlex.SelectWeightedRandom:

Public Member Functions

override ActionSelection Select (IList< ActionSelection > choices, Logging loggingState)

Protected Member Functions

virtual float GetNextNormalisedRandom ()
 override this to change the RNG used to select the action

Additional Inherited Members

- Public Types inherited from TenPN.DecisionFlex.ActionSelector
enum  Logging { IsEnabled, IsDisabled }

Detailed Description

Choose a good action but not always the best, using weights.

This is a good choice for your selector when you have to make the decision many times, and want a little bit of noise. You can use a low-pass filter to ignore completely unreasonable things. By default it uses unity's RNG, but you can derive from this class to override the RNG.

Member Function Documentation

override ActionSelection TenPN.DecisionFlex.SelectWeightedRandom.Select ( IList< ActionSelection choices,
Logging  loggingState 

given a list of actions and scores, pick the one that should be executed

choicesactions, each with a normalized score
loggingStateIsEnabled if the caller wants extra debugging sent to the console

Implements TenPN.DecisionFlex.ActionSelector.

The documentation for this class was generated from the following file: