跳至内容

UStatLoggerComponent

class UStatLoggerComponent : public UBlueprintEnvironmentUtilityComponent

Dependencies: FTrainerState, UBlueprintEnvironmentUtilityComponent

Inherits from: public UBlueprintEnvironmentUtilityComponent

公共接口

公共函数

LogToFile

bool LogToFile(FString TextToSave="")

将文本记录到日志文件。

Returns: 如果日志成功,则返回 True

参数

  • TextToSave (FString) – 要保存到文件的文本

返回: 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)

将奖励记录到日志文件。

Returns: 如果日志成功,则返回 True

参数

  • Reward (float) – 要记录的奖励

返回: 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

环境重置时的回调。

属性: 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

当代理在环境中采取一步时的回调。

参数

  • AgentID (int) – [in] 采取步骤的代理的 ID。
  • State (FTrainerState &) – [in] 代理采取步骤后的状态。

属性: 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

当代理在环境中注册时的回调。

参数

  • AgentID (int) – [in] 已注册代理的 ID。

属性: 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

环境初始化时的回调。

参数

  • Id (int) – [in] 环境的 ID。

属性: 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)

公共成员

TMap<int, float> AgentReward

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

一个从代理 ID 到本回合奖励的映射。

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

FDirectoryPath LogDirectory

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

将日志文件保存到的目录。

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

bool bAllowOverwritting

bool bAllowOverwritting = = true

日志文件是否可以被覆盖。

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

私有接口

私有成员

bool bFirstWrite

bool bFirstWrite = = true

是否为首次写入日志文件的标志

属性: private

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

FString LogFilePath

FString LogFilePath

日志文件的路径。

由提供的 LogDir 创建

属性: 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)

© . This site is unofficial and not affiliated with AMD.