Skip to content

UStatLoggerComponent

class UStatLoggerComponent : public UBlueprintEnvironmentUtilityComponent

Dependencies: FTrainerState, UBlueprintEnvironmentUtilityComponent

Inherits from: public UBlueprintEnvironmentUtilityComponent

Public Interface

Public Functions:

LogToFile

bool LogToFile(FString TextToSave="")

Log Text to the logfile.

Returns: True if the log was successful

Parameters:

  • TextToSave (FString) – The text to save to the file

Returns: bool

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 39, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 5-23)

LogReward

bool LogReward(float Reward)

Log a reward to the log file.

Returns: True if the log was successful

Parameters:

  • Reward (float) – The reward to log

Returns: bool

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 46, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 25-28)

OnEnvironmentReset

virtual void OnEnvironmentReset() override

Callback for when the environment is reset.

Attributes: virtual

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 48, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 30-43)

OnEnvironmentStep

virtual void OnEnvironmentStep(int AgentID, FTrainerState &State) override

Callback for when an agent takes a step in the environment.

Parameters:

  • AgentID (int) – [in] The ID of the agent that took the step.
  • State (FTrainerState &) – [in] The state of the agent after taking the step.

Attributes: virtual

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 50, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 45-48)

OnAgentRegister

virtual void OnAgentRegister(int AgentID) override

Callback for when an agent is registered in the environment.

Parameters:

  • AgentID (int) – [in] The ID of the agent that was registered.

Attributes: virtual

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 52, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 50-53)

OnEnvironmentInit

virtual void OnEnvironmentInit(int Id) override

Callback for when the environment is initialized.

Parameters:

  • Id (int) – [in] The ID of the environment.

Attributes: virtual

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 54, column 6)

Implementation: Schola/Source/Schola/Private/Environment/EnvironmentComponents/StatLoggerComponent.cpp (lines 55-59)

Public Members:

TMap<int, float> AgentReward

TMap<int, float> AgentReward = = TMap<int, float>()

A map from agent ID to its reward this episode.

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 21, column 6)

FDirectoryPath LogDirectory

FDirectoryPath LogDirectory = = FDirectoryPath&#123;&#125;

The directory to save the log file to.

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 27, column 16)

bool bAllowOverwritting

bool bAllowOverwritting = = true

Can the log file be overwritten.

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 31, column 6)

Private Interface

Private Members:

bool bFirstWrite

bool bFirstWrite = = true

flag for if this is the first write to the log file

Attributes: private

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 59, column 6)

FString LogFilePath

FString LogFilePath

The path to the log file.

Created from the supplied LogDir

Attributes: private

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 63, column 9)

Source: Schola/Source/Schola/Public/Environment/EnvironmentComponents/StatLoggerComponent.h (line 14, column 1)