UStatLoggerComponent
class UStatLoggerComponent : public UBlueprintEnvironmentUtilityComponentDependencies: 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{}将日志文件保存到的目录。
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)