Skip to content

Class ISingleAgentScholaEnvironment

Class ISingleAgentScholaEnvironment

  • Defined in File SingleAgentEnvironmentInterface.h

Inheritance Relationships

Base Type

class ISingleAgentScholaEnvironment : public IBaseScholaEnvironment

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

Dependencies: FAgentState, FInitialAgentState, FInteractionDefinition, FPoint

Interface for single-agent reinforcement learning environments.

Implement this interface in your environment class to create a single-agent RL environment. All methods are Blueprint Native Events, allowing implementation in either C++ or Blueprint.


Public Functions

SymbolDetails
InitializeEnvironmentInitialize the environment and define the agent’s observation and action spaces.
ResetReset the environment to its initial state.
StepExecute one environment step with the given action.
SeedEnvironmentSet the random seed for reproducible environment behavior.
SetEnvironmentOptionsConfigure the environment with custom options.

InitializeEnvironment

void InitializeEnvironment(FInteractionDefinition &OutAgentDefinition)

Initialize the environment and define the agent’s observation and action spaces.

Parameters

OutAgentDefinition – [out] The interaction definition containing observation/action space information.

#DirectionNameTypeDescription
1OutAgentDefinitionFInteractionDefinition &The interaction definition containing observation/action space information.

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

Reset

void Reset(FInitialAgentState &OutAgentState)

Reset the environment to its initial state.

Parameters

OutAgentState – [out] The initial agent state after reset, including the first observation.

#DirectionNameTypeDescription
1OutAgentStateFInitialAgentState &The initial agent state after reset, including the first observation.

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

Step

void Step(const FInstancedStruct &InAction, FAgentState &OutAgentState)

Execute one environment step with the given action.

Parameters

  • InAction – [in] The action selected by the agent for this step.

  • OutAgentState – [out] The resulting agent state (observation, reward, done flags, info).

#DirectionNameTypeDescription
1InActionconst FInstancedStruct &The action selected by the agent for this step.
2OutAgentStateFAgentState &The resulting agent state (observation, reward, done flags, info).

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

SeedEnvironment

void SeedEnvironment(int Seed)

Set the random seed for reproducible environment behavior.

Parameters

Seed – [in] The random seed value.

#DirectionNameTypeDescription
1SeedintThe random seed value.

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

SetEnvironmentOptions

void SetEnvironmentOptions(const TMap<FString, FString> &Options)

Configure the environment with custom options.

Parameters

Options – [in] Map of configuration option names to values.

#DirectionNameTypeDescription
1Optionsconst TMap< FString, FString > &Map of configuration option names to values.

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h


Public Static Functions

SymbolDetails
Execute_InitializeEnvironmentAdapter method to convert single-agent initialization to multi-agent format.
Execute_ResetAdapter method to convert single-agent reset to multi-agent format.
Execute_StepAdapter method to convert single-agent step to multi-agent format.

Execute_InitializeEnvironment

static inline void Execute_InitializeEnvironment(
UObject *Obj, TMap<FString, FInteractionDefinition> &OutAgentDefinitions)

Adapter method to convert single-agent initialization to multi-agent format.

Parameters

  • Obj – [in] The environment object.

  • OutAgentDefinitions – [out] Map of agent IDs to definitions (will contain one entry “SingleAgent”).

#DirectionNameTypeDescription
1ObjUObject *The environment object.
2OutAgentDefinitionsTMap< FString, FInteractionDefinition > &Map of agent IDs to definitions (will contain one entry “SingleAgent”).

Attributes: inline, static

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

Execute_Reset

static inline void
Execute_Reset(UObject *Obj, TMap<FString, FInitialAgentState> &OutAgentState)

Adapter method to convert single-agent reset to multi-agent format.

Parameters

  • Obj – [in] The environment object.

  • OutAgentState – [out] Map of agent IDs to states (will contain one entry “SingleAgent”).

#DirectionNameTypeDescription
1ObjUObject *The environment object.
2OutAgentStateTMap< FString, FInitialAgentState > &Map of agent IDs to states (will contain one entry “SingleAgent”).

Attributes: inline, static

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h

Execute_Step

static inline void
Execute_Step(UObject *Obj,
const TMap<FString, TInstancedStruct<FPoint>> &InActions,
TMap<FString, FAgentState> &OutAgentStates)

Adapter method to convert single-agent step to multi-agent format.

Parameters

  • Obj – [in] The environment object.

  • InActions – [in] Map of agent IDs to actions (expects one entry “SingleAgent”).

  • OutAgentStates – [out] Map of agent IDs to states (will contain one entry “SingleAgent”).

#DirectionNameTypeDescription
1ObjUObject *The environment object.
2InActionsconst TMap< FString, TInstancedStruct< FPoint > > &Map of agent IDs to actions (expects one entry “SingleAgent”).
3OutAgentStatesTMap< FString, FAgentState > &Map of agent IDs to states (will contain one entry “SingleAgent”).

Attributes: inline, static

Source: Source/Schola/Training/Public/Environment/SingleAgentEnvironmentInterface.h