浏览代码

updated heuristic

/soccer-comms/disc
Andrew Cohen 4 年前
当前提交
5b2e704f
共有 5 个文件被更改,包括 30 次插入23 次删除
  1. 8
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
  2. 19
      Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
  3. 14
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  4. 8
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccerCollab.cs
  5. 4
      config/ppo/SoccerTwos.yaml

8
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab


VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 5022602860645237092, guid: 191c36f874b274185a637be2d959a324, type: 3}
m_Model: {fileID: 5022602860645237092, guid: 0793e0466d1074c3c902e854b9b2a289, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: SoccerTwos

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 5022602860645237092, guid: 191c36f874b274185a637be2d959a324, type: 3}
m_Model: {fileID: 5022602860645237092, guid: 0793e0466d1074c3c902e854b9b2a289, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: SoccerTwos

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 5022602860645237092, guid: 191c36f874b274185a637be2d959a324, type: 3}
m_Model: {fileID: 5022602860645237092, guid: 0793e0466d1074c3c902e854b9b2a289, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: SoccerTwos

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 5022602860645237092, guid: 191c36f874b274185a637be2d959a324, type: 3}
m_Model: {fileID: 5022602860645237092, guid: 0793e0466d1074c3c902e854b9b2a289, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: SoccerTwos

19
Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity


objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
- target: {fileID: 1141134673700168, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 4558743310993102, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 114387866097048300, guid: 54f3340298537426e96a6cc530e2d5d8,
type: 3}
propertyPath: m_BehaviorType
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54f3340298537426e96a6cc530e2d5d8, type: 3}

14
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs


}
else
{
m_LateralSpeed = 0.3f;
m_ForwardSpeed = 1.0f;
m_LateralSpeed = 0.6f;
m_ForwardSpeed = 1.5f;
}
m_SoccerSettings = FindObjectOfType<SoccerSettings>();
agentRb = GetComponent<Rigidbody>();

// break;
//}
transform.Rotate(rotateDir, Time.deltaTime * 100f);
transform.Rotate(rotateDir, Time.deltaTime * 200f);
agentRb.AddForce(dirToGo * m_SoccerSettings.agentRunSpeed,
ForceMode.VelocityChange);
}

contOut[0] = -1f;
}
//rotate
if (Input.GetKey(KeyCode.A))
if (Input.GetKey(KeyCode.Q))
if (Input.GetKey(KeyCode.D))
if (Input.GetKey(KeyCode.E))
if (Input.GetKey(KeyCode.E))
if (Input.GetKey(KeyCode.D))
if (Input.GetKey(KeyCode.Q))
if (Input.GetKey(KeyCode.A))
{
contOut[2] = -1f;
}

8
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccerCollab.cs


contOut[0] = -1f;
}
//rotate
if (Input.GetKey(KeyCode.A))
if (Input.GetKey(KeyCode.Q))
if (Input.GetKey(KeyCode.D))
if (Input.GetKey(KeyCode.E))
if (Input.GetKey(KeyCode.E))
if (Input.GetKey(KeyCode.D))
if (Input.GetKey(KeyCode.Q))
if (Input.GetKey(KeyCode.A))
{
contOut[2] = -1f;
}

4
config/ppo/SoccerTwos.yaml


gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 50000000
max_steps: 100000000
time_horizon: 1000
summary_freq: 10000
threaded: false

window: 10
play_against_latest_model_ratio: 0.5
initial_elo: 1200.0
env_settings:
num_envs: 4
正在加载...
取消
保存