Class responsible for assigning behaviors using Utility System algorithm. All considered behaviors are given a score designating their utility in current situation. Most suitable behavior is chosen based on those scores.
More...
Class responsible for assigning behaviors using Utility System algorithm. All considered behaviors are given a score designating their utility in current situation. Most suitable behavior is chosen based on those scores.
◆ UtilityReasoner()
| Grail.Utility.Reasoners.UtilityReasoner.UtilityReasoner |
( |
List< BlueprintOption< Behavior, EntityBlackboardPair, AIEntity >> |
blueprintOptions, |
|
|
float |
persistence = 0.1f |
|
) |
| |
|
inlineprotected |
Constructor.
- Parameters
-
| blueprintOptions | Blueprints mapped with evaluators. |
| persistence | Bonus score that currently executed behavior(or behavior from the top of the stack) gains during behavior selection. Persistence of 0 give no bonus at all, negative persistence causes unstable entity behaviors. |
◆ ClearCache()
| override void Grail.Utility.Reasoners.UtilityReasoner.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.
◆ CreateSnapshotGenerator()
| override ISnapshotGenerator Grail.Utility.Reasoners.UtilityReasoner.CreateSnapshotGenerator |
( |
int |
entityId | ) |
|
|
inlinevirtual |
Creates object responsible for producing snapshots for this reasoner assigned to particular entity.
- Parameters
-
| entityId | ID of Entity to which this reasoner is assigned. |
- Returns
- Created snapshot generator.
Reimplemented from Grail.Core.Reasoner.
◆ GetUtilityReasonerSnapshot()
Returns copy of current snapshot and clear the original data.
- Returns
- Current state's snapshot.
◆ SetSnapshotProduction()
| void Grail.Utility.Reasoners.UtilityReasoner.SetSnapshotProduction |
( |
bool |
isEnabled | ) |
|
|
inline |
Tells reasoner whether it should produce debug snapshots of its state.
- Parameters
-
◆ StageBehavior()
| override void Grail.Utility.Reasoners.UtilityReasoner.StageBehavior |
( |
AIEntity |
entity | ) |
|
|
inlinevirtual |
Selects behavior, if able, and assigns it to entity.
- Parameters
-
| entity | Owner entity to which selected behavior will be assigned. |
Implements Grail.Core.Reasoner.
◆ Validator()
| delegate bool Grail.Utility.Reasoners.UtilityReasoner.Validator |
( |
in int |
index | ) |
|
The documentation for this class was generated from the following file:
- GrailUtilityAI/source/Reasoners/UtilityReasoner.cs