浏览代码

soccer curriculum

/asymm-envs
Andrew Cohen 5 年前
当前提交
72706301
共有 3 个文件被更改,包括 15 次插入1 次删除
  1. 7
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  2. 2
      config/trainer_config.yaml
  3. 7
      config/curricula/soccer.yaml

7
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs


float m_KickPower;
int m_PlayerIndex;
public SoccerFieldArea area;
float m_BallTouch;
public Position position;
float m_Power;

var force = m_Power * m_KickPower;
if (c.gameObject.CompareTag("ball"))
{
// Generic gets curriculum
if (position == Position.Generic)
{
AddReward(.2f * m_BallTouch);
}
var dir = c.contacts[0].point - transform.position;
dir = dir.normalized;
c.gameObject.GetComponent<Rigidbody>().AddForce(dir * force);

public override void OnEpisodeBegin()
{
m_BallTouch = Academy.Instance.FloatProperties.GetPropertyWithDefault("ball_touch", 0);
if (team == Team.Purple)
{
transform.rotation = Quaternion.Euler(0f, -90f, 0f);

2
config/trainer_config.yaml


SoccerTwos:
normalize: false
max_steps: 1.0e8
max_steps: 3.0e7
learning_rate_schedule: constant
batch_size: 2048
buffer_size: 20480

7
config/curricula/soccer.yaml


SoccerTwos:
measure: progress
thresholds: [0.05, 0.1]
min_lesson_length: 100
signal_smoothing: true
parameters:
ball_touch: [1.0, 0.5, 0.0]
正在加载...
取消
保存