浏览代码

Merge branch 'soccer-2v1' into asymm-envs

/asymm-envs
Andrew Cohen 4 年前
当前提交
3bd33889
共有 4 个文件被更改,包括 18 次插入2 次删除
  1. 2
      Project/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab
  2. 9
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  3. 2
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisArea.cs
  4. 7
      config/curricula/tennis.yaml

2
Project/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab


m_GameObject: {fileID: 1273406647218856}
serializedVersion: 2
m_Mass: 0.75
m_Drag: 0
m_Drag: 0.1
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0

9
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


TennisArea m_Area;
float m_InvertMult;
FloatPropertiesChannel m_ResetParams;
float m_BallTouch;
// Looks for the scoreboard based on the name of the gameObjects.
// Do not modify the names of the Score GameObjects

return action;
}
void OnCollisionEnter(Collision c)
{
if (c.gameObject.CompareTag("ball"))
{
AddReward(.1f * m_BallTouch);
}
}
m_BallTouch = SideChannelUtils.GetSideChannel<FloatPropertiesChannel>().GetPropertyWithDefault("ball_touch", 0);
m_InvertMult = invertX ? -1f : 1f;
if (m_InvertMult == 1f)
{

2
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisArea.cs


void FixedUpdate()
{
var rgV = m_BallRb.velocity;
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -9f, 9f), Mathf.Clamp(rgV.y, -9f, 9f), rgV.z);
//m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -9f, 9f), Mathf.Clamp(rgV.y, -9f, 9f), rgV.z);
}
}

7
config/curricula/tennis.yaml


Tennis:
measure: progress
thresholds: [0.05, 0.1]
min_lesson_length: 100
signal_smoothing: true
parameters:
ball_touch: [1.0, 0.5, 0.0]
正在加载...
取消
保存