浏览代码

fixed agent action constraint tennis

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

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


var moveY = Mathf.Clamp(vectorAction[1], -1f, 1f);
var rotate = Mathf.Clamp(vectorAction[2], -1f, 1f) * m_InvertMult;
if (moveY > 0.5 && transform.position.y - transform.parent.transform.position.y < -1.5f)
if (moveY > 0.0)// && transform.position.y - transform.parent.transform.position.y < -1.5f)
m_AgentRb.velocity = new Vector3(m_AgentRb.velocity.x, 7f, 0f);
m_AgentRb.velocity = new Vector3(m_AgentRb.velocity.x, moveY * 20f, 0f);
}
m_AgentRb.velocity = new Vector3(moveX * 30f, m_AgentRb.velocity.y, 0f);

{
if (c.gameObject.CompareTag("ball"))
{
AddReward(.1f * m_BallTouch);
AddReward(.2f * m_BallTouch);
}
}
public override void OnEpisodeBegin()

正在加载...
取消
保存