浏览代码

slower x

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

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


m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 10
VectorObservationSize: 14
NumStackedVectorObservations: 3
VectorActionSize: 03000000
VectorActionDescriptions: []

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 10
VectorObservationSize: 14
NumStackedVectorObservations: 3
VectorActionSize: 03000000
VectorActionDescriptions: []

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


sensor.AddObservation(m_InvertMult * m_BallRb.velocity.x);
sensor.AddObservation(m_BallRb.velocity.y);
//sensor.AddObservation(m_InvertMult * (OpponentRb.position.x - myArea.transform.position.x));
//sensor.AddObservation(OpponentRb.position.y - myArea.transform.position.y);
//sensor.AddObservation(m_InvertMult * OpponentRb.velocity.x);
//sensor.AddObservation(OpponentRb.velocity.y);
sensor.AddObservation(m_InvertMult * (OpponentRb.position.x - myArea.transform.position.x));
sensor.AddObservation(OpponentRb.position.y - myArea.transform.position.y);
sensor.AddObservation(m_InvertMult * OpponentRb.velocity.x);
sensor.AddObservation(OpponentRb.velocity.y);
sensor.AddObservation(m_InvertMult * gameObject.transform.rotation.z);
//sensor.AddObservation((m_InvertMult * (gameObject.transform.rotation.eulerAngles.z - (1f - m_InvertMult) * 180f) - 35f) / 125f);

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

transform.position.z);
}
var rgV = m_AgentRb.velocity;
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 10f), rgV.z);
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -10, 10), Mathf.Min(rgV.y, 10f), rgV.z);
// timePenalty -= m_Existential;
m_TextComponent.text = score.ToString();

正在加载...
取消
保存