UBTTask_AgentStep
class UBTTask_AgentStep : public UBTTaskNode, public IInferenceAgent
A BTTask that runs a step of inference to determine the action taken by the model.
Dependencies
This type depends on:
- FActTickFunction
- FThinkTickFunction
- IInferenceAgent
- UAbstractBrain
- UAbstractObserver
- UAbstractPolicy
- UActuator
- UInteractionManager
Inherits from: public UBTTaskNode, public IInferenceAgent
Public Interface
Constructor:
UBTTask_AgentStep
UBTTask_AgentStep(FObjectInitializer const &ObjectInitializer)
Task Constructor.
Parameters:
Name | Type | Default |
---|---|---|
ObjectInitializer | FObjectInitializer const & | “ |
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 28, column 1)
Implementation: Schola/Source/Schola/Private/Inference/BT/BTT_AgentStep.cpp
(lines 5-11)
Public Functions:
GetControlledPawn
inline virtual APawn * GetControlledPawn() override
Get the controlled pawn of the agent.
Returns: A pointer to the controlled pawn.
Returns: APawn *
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 74, column 15)
GetInteractionManager
inline virtual UInteractionManager * GetInteractionManager() override
Get the interaction manager for collecting actuators and observations.
Returns: A pointer to an interaction manager object.
Returns: UInteractionManager *
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 79, column 29)
GetBrain
inline virtual UAbstractBrain * GetBrain() override
Get the brain of the agent.
Returns: A pointer to a brain object.
Returns: UAbstractBrain *
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 84, column 24)
GetPolicy
inline virtual UAbstractPolicy * GetPolicy() override
Get the policy of the agent.
Returns: A pointer to a policy object.
Returns: UAbstractPolicy *
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 89, column 25)
GetAllObservers
inline virtual TArray<UAbstractObserver *> GetAllObservers() override
Get both the observers attached to the controlled pawn and the observers attached to the agent.
Returns: An array of observer objects.
Returns: TArray<UAbstractObserver *>
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 94, column 16)
GetAllActuators
inline virtual TArray<UActuator *> GetAllActuators() override
Get both the actuators attached to the controlled pawn and the actuators attached to the agent.
Returns: An array of actuator objects.
Returns: TArray<UActuator *>
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 102, column 16)
GetStatus
inline virtual EAgentStatus GetStatus() override
Get the status of the agent.
Returns: The status of the agent.
Returns: EAgentStatus
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 110, column 22)
SetStatus
inline virtual void SetStatus(EAgentStatus NewStatus) override
Set the status of the agent.
Parameters:
NewStatus
(EAgentStatus
) – The new status to set.
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 115, column 14)
TickTask
virtual void TickTask(UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, float DeltaSeconds) override
Parameters:
Name | Type | Default |
---|---|---|
OwnerComp | UBehaviorTreeComponent & | “ |
NodeMemory | uint8 * | “ |
DeltaSeconds | float | “ |
Attributes: virtual
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 120, column 14)
Implementation: Schola/Source/Schola/Private/Inference/BT/BTT_AgentStep.cpp
(lines 23-30)
Public Members:
UInteractionManager * InteractionManager
UInteractionManager * InteractionManager = = CreateDefaultSubobject<UInteractionManager>(TEXT("InteractionManager"))
Object defining how the agent interacts with the environment.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 32, column 21)
UAbstractPolicy * Policy
UAbstractPolicy * Policy
Object defining an asynchronous function f:Observations->Actions used to make decisions for the agent.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 36, column 17)
UAbstractBrain * Brain
UAbstractBrain * Brain
Object defining how decisions requests are synchronized.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 40, column 16)
TArray<UAbstractObserver *> Observers
TArray<UAbstractObserver *> Observers
List of observers that collect observations for the agent.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 44, column 8)
TArray<UActuator *> Actuators
TArray<UActuator *> Actuators
List of actuators that execute actions for the agent.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 48, column 8)
EAgentStatus Status
EAgentStatus Status = = EAgentStatus::Running
The status of the agent.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 52, column 14)
bool bRegisterAgentStep
bool bRegisterAgentStep = = true
Whether the agent should be setup to take actions automatically.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 56, column 6)
FThinkTickFunction ThinkTickFunction
FThinkTickFunction ThinkTickFunction = = FThinkTickFunction(this)
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 60, column 20)
FActTickFunction ActTickFunction
FActTickFunction ActTickFunction = = FActTickFunction(this, true)
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 64, column 18)
bool bUseTickTask
bool bUseTickTask = = false
Whether to tick the task instead of executing it.
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 68, column 6)
Private Interface
Private Functions:
ExecuteTask
EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory)
Parameters:
Name | Type | Default |
---|---|---|
OwnerComp | UBehaviorTreeComponent & | “ |
NodeMemory | uint8 * | “ |
Returns: EBTNodeResult::Type
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 24, column 21)
Implementation: Schola/Source/Schola/Private/Inference/BT/BTT_AgentStep.cpp
(lines 13-21)
Step
void Step(UBehaviorTreeComponent &OwnerComp)
Parameters:
Name | Type | Default |
---|---|---|
OwnerComp | UBehaviorTreeComponent & | “ |
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 131, column 6)
Implementation: Schola/Source/Schola/Private/Inference/BT/BTT_AgentStep.cpp
(lines 32-46)
Private Members:
bool bConnected
bool bConnected = = false
Whether the connection to owner pawn has been established.
Attributes: private
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 125, column 6)
APawn * OwnerPawn
APawn * OwnerPawn
The pawn that performs this task.
Attributes: private
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 129, column 7)
EBTNodeResult::Type TaskResult
EBTNodeResult::Type TaskResult = = EBTNodeResult::InProgress
Attributes: private
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 133, column 21)
Source: Schola/Source/Schola/Public/Inference/BT/BTT_AgentStep.h
(line 20, column 1)