浏览代码

added positions to behaviorparameters

/soccer-fives/multiagent
Andrew Cohen 5 年前
当前提交
926bc888
共有 3 个文件被更改,包括 112 次插入11 次删除
  1. 117
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldFives.prefab
  2. 1
      com.unity.ml-agents/Editor/BehaviorParametersEditor.cs
  3. 5
      com.unity.ml-agents/Runtime/Policy/BehaviorParameters.cs

117
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldFives.prefab


- {fileID: 4540034559941056}
- {fileID: 2148914632064875291}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!54 &54348679551516588
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 1
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &114492261207303438
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 0
area: {fileID: 114559182131992928}

- {fileID: 4991109413118678}
- {fileID: 4942358209803819540}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!54 &54609996481602788
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &114850431417842684
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 1
area: {fileID: 114559182131992928}

- {fileID: 4540201673231058}
- {fileID: 4867652605555692}
- {fileID: 4109868016055942}
- {fileID: 2742884993155201988}
- {fileID: 4444285537983296}
- {fileID: 6592692268509673203}
- {fileID: 5762487118034748752}

- {fileID: 5751751795015510571}
- {fileID: 6125218000342064285}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!54 &792168953693601571
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 1
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &6954070104302829726
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 0
area: {fileID: 114559182131992928}

- {fileID: 4487837607097757299}
- {fileID: 2577118983503834457}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!54 &4740781342817847438
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &2022429702144620855
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 1
area: {fileID: 114559182131992928}

- {fileID: 705078624341413935}
- {fileID: 3001231927452012652}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!54 &6686455466793116393
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 1
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &6855830296884182341
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 0
area: {fileID: 114559182131992928}

- {fileID: 9148156014225625547}
- {fileID: 7035483554984300467}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!54 &6173031634930322379
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &582843529477248009
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 1
area: {fileID: 114559182131992928}

- {fileID: 3346248107740252558}
- {fileID: 4373164346437030907}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!54 &2610000939768136006
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 1
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &2375211931252174569
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 0
area: {fileID: 114559182131992928}

- {fileID: 6133779038795925749}
- {fileID: 4100055162363763593}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!54 &4166394328999621115
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &5596404811566570806
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 1
area: {fileID: 114559182131992928}

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &5835087315797701971
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2742884993155201988}
- component: {fileID: 6592473545973587338}
m_Layer: 0
m_Name: BlueCritic
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2742884993155201988
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5835087315797701971}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4558743310993102}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6592473545973587338
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5835087315797701971}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 1
numStackedVectorObservations: 1
vectorActionSize:
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 0}
m_InferenceDevice: 0
m_BehaviorType: 1
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: critic
m_UseChildSensors: 1
--- !u!1 &5861694282626165495
GameObject:
m_ObjectHideFlags: 0

- {fileID: 7843244083652691923}
- {fileID: 402429278731114673}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!54 &994668501279332153
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 1
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &7920144334342864513
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 0
area: {fileID: 114559182131992928}

- {fileID: 2438437950049752534}
- {fileID: 6735248220539025067}
m_Father: {fileID: 4558743310993102}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!54 &901361471225169854
Rigidbody:

m_BehaviorType: 0
m_BehaviorName: SoccerFives
m_TeamID: 0
m_Position: Striker
m_UseChildSensors: 1
--- !u!114 &1559066246895354931
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 2a2688ef4a36349f9aa010020c32d198, type: 3}
m_Name:
m_EditorClassIdentifier:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
team: 1
area: {fileID: 114559182131992928}

1
com.unity.ml-agents/Editor/BehaviorParametersEditor.cs


EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(so.FindProperty("m_BehaviorType"));
EditorGUILayout.PropertyField(so.FindProperty("m_TeamID"));
EditorGUILayout.PropertyField(so.FindProperty("m_Position"));
EditorGUILayout.PropertyField(so.FindProperty("m_UseChildSensors"), true);
// EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Heuristic"), true);
EditorGUI.indentLevel--;

5
com.unity.ml-agents/Runtime/Policy/BehaviorParameters.cs


[HideInInspector]
[SerializeField]
public int m_TeamID;
[HideInInspector]
[SerializeField]
public string m_Position;
[FormerlySerializedAs("m_useChildSensors")]
[HideInInspector]
[SerializeField]

/// </summary>
public string fullyQualifiedBehaviorName
{
get { return m_BehaviorName + "?team=" + m_TeamID; }
get { return m_BehaviorName + "?team=" + m_TeamID + "&position=" + m_Position; }
}
internal IPolicy GeneratePolicy(Func<float[]> heuristic)

正在加载...
取消
保存