浏览代码

constrain x tennis

/asymm-envs
Andrew Cohen 5 年前
当前提交
03eef40b
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 6
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  2. 2
      config/ppo/Tennis.yaml

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


Quaternion deltaRotation = Quaternion.Euler(zAxis * rotateZ);
m_AgentRb.MoveRotation(m_AgentRb.rotation * deltaRotation);
if (invertX && transform.position.x - transform.parent.transform.position.x < -m_InvertMult ||
!invertX && transform.position.x - transform.parent.transform.position.x > -m_InvertMult)
if (invertX && transform.position.x - transform.parent.transform.position.x < -m_InvertMult * 5f ||
!invertX && transform.position.x - transform.parent.transform.position.x > -m_InvertMult * 5f)
transform.position = new Vector3(-m_InvertMult + transform.parent.transform.position.x,
transform.position = new Vector3(-m_InvertMult * 5f + transform.parent.transform.position.x,
transform.position.y,
transform.position.z);
}

2
config/ppo/Tennis.yaml


gamma: 0.995
self_play:
window: 10
play_against_latest_model_ratio: 0.5
play_against_latest_model_ratio: 0.0
save_steps: 100000
swap_steps: 2000
team_change: 200000
正在加载...
取消
保存