浏览代码

slower tennis

/asymm-envs
Andrew Cohen 4 年前
当前提交
4907a9cd
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 4
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  2. 2
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisArea.cs

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


//m_AgentRb.velocity = new Vector3(m_AgentRb.velocity.x, moveY * 20f, 0f);
}
m_AgentRb.AddForce(new Vector3(moveX * 30f, upward * 10f, 0f), ForceMode.VelocityChange);
m_AgentRb.AddForce(new Vector3(moveX * 20f, upward * 10f, 0f), ForceMode.VelocityChange);
//m_AgentRb.velocity = new Vector3(moveX * 30f, m_AgentRb.velocity.y, 0f);
m_AgentRb.transform.rotation = Quaternion.Euler(0f, -180f, 55f * rotate + m_InvertMult * 90f);

transform.position.z);
}
var rgV = m_AgentRb.velocity;
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -30, 30), Mathf.Min(rgV.y, 20f), rgV.z);
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 20f), rgV.z);
// energy usage penalty cumulant
energyPenalty += -0.001f * (Mathf.Abs(moveX) + upward);

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


{
m_BallRb.AddForce(down);
var rgV = m_BallRb.velocity;
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -40f, 40f), Mathf.Min(rgV.y, 45f), rgV.z);
m_BallRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -30f, 30f), Mathf.Min(rgV.y, 45f), rgV.z);
}
}
正在加载...
取消
保存