Class UAbstractBrain

class UAbstractBrain : public UObject

An AbstractBaseClass for subclasses representing different ways of synchronizing policy, observations and actions.

Subclassed by USynchronousBrain

Public Functions

UAbstractBrain()
void IncrementStep()

Increment the current agent step.

void SetStep(int NewStep)

Set the current agent step.

Parameters:

NewStep – the value to update the step too

void ResetStep()

Reset the agent’s count of steps to 0.

bool IsActive()

Check if this brain is active (e.g.

Not closed or errored out)

Returns:

true iff this brain is functional (e.g. Not closed or errored out)

inline virtual void Reset()

Reset this brain.

virtual bool IsDecisionStep(int StepToCheck)

Check whether a specific step will require a brain decision.

Parameters:

StepToCheck – the timestep to check

Returns:

true iff the agent should be requesting a decision

virtual bool IsDecisionStep()

If the current step is a decision step, as defined by the step frequency.

Returns:

true iff the current step is a decision step

void Init(UAbstractPolicy *InjectedPolicy)

Initialize this brain by supplying a policy.

Note

this is so that we can avoid having massively nested structs in the editor when opening the Agent

Parameters:

InjectedPolicy[inout] The policy that this brain will use to make decisions

inline virtual bool HasAction()

Check if this brain has an action prepared.

Returns:

true iff this brain has an action prepared (e.g. a GetAction() call on this step will suceed)

inline virtual FAction *GetAction()

get an action from this brain

Returns:

A pointer to the current action

inline virtual bool RequestDecision(const FDictPoint &Observations)

Request that the brain determine a new action.

Parameters:

Observations[in] The current state of the agent used to inform the brains choice of action

Returns:

Status True if decision request suceeded and False otherwise

virtual bool GetAbstractSettingsVisibility() const

Use by subclasses to set whether the settings are visible or not.

Returns:

true if settings in this class are visible in the editor.

virtual EBrainStatus GetStatus()

Get the last status of the brain.

Returns:

the last status

virtual void SetStatus(EBrainStatus NewStatus)

Update the status of the brain.

Parameters:

NewStatus[in] The new status to set

virtual void UpdateStatusFromDecision(const FPolicyDecision &Decision)

Update the status of the brain from a PolicyDecision.

Parameters:

Decision[in] The PolicyDecision to unpack and use when updating the status

inline virtual void ResolveDecision()

Inform the policy that you will require a response decision iminently, so it should resolve the open decision and update it’s status accordingly.

virtual bool IsActionStep()

Check if brain has an action, and it’s an action step.

Returns:

true if the brain has an action and it’s an action step

Public Members

UAbstractPolicy *Policy

The underlying policy this brain wraps.

bool bTakeActionBetweenDecisions = true

If true the agent will repeat it’s last action each step between decision requests.

int Step = 0

The current step of the simulation.

int DecisionRequestFrequency = 5

The number of steps between requests for new actions.

If this is different across agents it may cause issues training in some frameworks (e.g. Stable Baselines 3).

bool bAbstractSettingsVisibility = true

Toggle for whether the user can see the settings for this class.

Use to hide in subclass if they aren’t relevant

EBrainStatus Status = EBrainStatus::Running

The status of the brain.

Related pages

  • Visit the Schola product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!