您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.5 KiB
38 行
1.5 KiB
using UnityEngine;
|
|
|
|
namespace Unity.MLAgents
|
|
{
|
|
internal class UnityRLCapabilities
|
|
{
|
|
public bool BaseRLCapabilities;
|
|
public bool ConcatenatedPngObservations;
|
|
|
|
/// <summary>
|
|
/// A class holding the capabilities flags for Reinforcement Learning across C# and the Trainer codebase. This
|
|
/// struct will be used to inform users if and when they are using C# / Trainer features that are mismatched.
|
|
/// </summary>
|
|
public UnityRLCapabilities(bool baseRlCapabilities = true, bool concatenatedPngObservations = true)
|
|
{
|
|
BaseRLCapabilities = baseRlCapabilities;
|
|
ConcatenatedPngObservations = concatenatedPngObservations;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Will print a warning to the console if Python does not support base capabilities and will
|
|
/// return <value>true</value> if the warning was printed.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool WarnOnPythonMissingBaseRLCapabilities()
|
|
{
|
|
if (BaseRLCapabilities)
|
|
{
|
|
return false;
|
|
}
|
|
Debug.LogWarning("Unity has connected to a Training process that does not support" +
|
|
"Base Reinforcement Learning Capabilities. Please make sure you have the" +
|
|
" latest training codebase installed for this version of the ML-Agents package.");
|
|
return true;
|
|
}
|
|
|
|
}
|
|
}
|