浏览代码

added team id and identifier concat to behavior parameters

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

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


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

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


[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)

正在加载...
取消
保存