1 #ifndef GRAIL_UTILITY_REASONER_H
2 #define GRAIL_UTILITY_REASONER_H
4 #include "../../GrailCore/Reasoner.hh"
5 #include "../../GrailEvaluators/Evaluator.hh"
6 #include "../Selector.hh"
7 #include "../../GrailData/DebugInfo/UtilityReasonerSnapshot.h"
8 #include "../../GrailData/UtilityModel/UtilitySelectorModel.h"
21 std::shared_ptr<utility::Evaluator<utility::EntityBlackboardPair>> evaluator;
47 SelectionMethod selectionMethod = SelectionMethod::MAX,
48 float persistence = 0.1f);
82 std::vector<std::unique_ptr<Behavior>> GenerateContextsAndInstances(
const AIEntity& entity);
83 void ValidateOperationStack(
const AIEntity& entity);
84 void SelectBehaviorFromStack(
AIEntity& entity);
86 std::vector<BlueprintOption> blueprintOptions = {};
88 std::vector<utility::Option<utility::EntityBlackboardPair>> generatedOptions{};
91 SelectionMethod selectionMethod = SelectionMethod::MAX;
93 float persistence = 0.0f;
95 bool produceSnapshot =
false;
97 mutable std::mutex snapshotMutex;
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
The Reasoner class - Entity's "brain", assigns them behaviors chosen by user-defined algorithms.
Definition: Reasoner.hh:20
The UtilityReasoner class - Class responsible for assigning behaviors using Utility System algorithm....
Definition: UtilityReasoner.hh:37
void SetSnapshotProduction(bool isEnabled)
SetSnapshotProduction - Tells reasoner whether it should produce debug snapshots of its state.
Definition: UtilityReasoner.cpp:165
UtilityReasoner(std::vector< BlueprintOption > &&blueprintOptions, SelectionMethod selectionMethod=SelectionMethod::MAX, float persistence=0.1f)
UtilityReasoner - Constructor.
Definition: UtilityReasoner.cpp:21
std::unique_ptr< ISnapshotGenerator > CreateSnapshotGenerator(size_t entityId) override
CreateSnapshotGenerator - Creates object responsible for producing snapshots for this reasoner assign...
Definition: UtilityReasoner.cpp:153
void SelectBehavior(AIEntity &entity) override
SelectBehavior - Selects behavior, if able, and assigns it to entity.
Definition: UtilityReasoner.cpp:27
UtilityReasonerSnapshot GetUtilityReasonerSnapshot() const
GetUtilityReasonerSnapshot - Returns copy of current snapshot and clear the original data.
Definition: UtilityReasoner.cpp:158
The Blueprint class - Responsible for producing contexts and instances of data used by UtilityReasone...
Definition: Blueprint.hh:29
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:21
Definition: UtilityReasoner.hh:20
Definition: UtilityReasonerSnapshot.h:11