浏览代码

better

/asymm-envs
Andrew Cohen 5 年前
当前提交
6852707a
共有 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


upward = moveY;
}
m_AgentRb.AddForce(new Vector3(moveX * 2.5f, upward * 10f, 0f), ForceMode.VelocityChange);
m_AgentRb.AddForce(new Vector3(moveX * 5f, upward * 10f, 0f), ForceMode.VelocityChange);
// calculate angle between m_InvertMult * 55 and m_InvertMult * 125
var angle = 35f * rotate + m_InvertMult * k_Angle;

timePenalty = 0;
m_InvertMult = invertX ? -1f : 1f;
var agentOutX = Random.Range(14f, 16f);
var agentOutX = Random.Range(18f, 20f);
var agentOutY = Random.Range(-1.5f, 0f);
transform.position = new Vector3(-m_InvertMult * agentOutX, agentOutY, -1.8f) + transform.parent.transform.position;
m_AgentRb.velocity = new Vector3(0f, 0f, 0f);

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


serve = -1f;
}
ball.transform.position = new Vector3(serve * ballOut, 1f, 0f) + transform.position;
m_BallRb.velocity = new Vector3(serve * 2f, 20f, 0f);
m_BallRb.velocity = new Vector3(serve * 5f, 10f, 0f);
ball.transform.localScale = new Vector3(.5f, .5f, .5f);
m_BallScript.ResetPoint();
}

正在加载...
取消
保存