浏览代码

added team id and identifier concat to behavior parameters

/develop-newnormalization
Andrew Cohen 5 年前
当前提交
518ce6f8
共有 2 个文件被更改,包括 16 次插入2 次删除
  1. 1
      UnitySDK/Assets/ML-Agents/Editor/BehaviorParametersEditor.cs
  2. 17
      UnitySDK/Assets/ML-Agents/Scripts/Policy/BehaviorParameters.cs

1
UnitySDK/Assets/ML-Agents/Editor/BehaviorParametersEditor.cs


EditorGUILayout.PropertyField(so.FindProperty("m_InferenceDevice"), true);
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(so.FindProperty("m_UseHeuristic"));
EditorGUILayout.PropertyField(so.FindProperty("m_TeamID"));
// EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Heuristic"), true);
EditorGUI.indentLevel--;
if (EditorGUI.EndChangeCheck())

17
UnitySDK/Assets/ML-Agents/Scripts/Policy/BehaviorParameters.cs


bool m_UseHeuristic;
[HideInInspector] [SerializeField]
string m_BehaviorName = "My Behavior";
[HideInInspector] [SerializeField]
int m_TeamID = 0;
//[HideInInspector] [SerializeField]
//string m_BehaviorIdentifier;
private string concatBehaviorIdentifiers()
{
return m_BehaviorName + "?team=" + m_TeamID;
}
public BrainParameters brainParameters
{

public string behaviorName
{
get { return m_BehaviorName; }
get { return concatBehaviorIdentifiers();}
}
public IPolicy GeneratePolicy(Func<float[]> heuristic)

}
if (FindObjectOfType<Academy>().IsCommunicatorOn)
{
return new RemotePolicy(m_BrainParameters, m_BehaviorName);
return new RemotePolicy(m_BrainParameters, concatBehaviorIdentifiers());
}
if (m_Model != null)
{

正在加载...
取消
保存