浏览代码

curriculum for small soldiers

/develop/cubewars
Andrew Cohen 5 年前
当前提交
c13259fd
共有 2 个文件被更改,包括 12 次插入3 次删除
  1. 8
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/SmallCubeAgent.cs
  2. 7
      config/curricula/cube_wars.yaml

8
Project/Assets/ML-Agents/Examples/CubeWars/Scripts/SmallCubeAgent.cs


float m_HitPoints;
// Speed of agent rotation.
public float turnSpeed;
float m_Bonus;
// Speed of agent movement.
public float moveSpeed;

sensor.AddObservation(angle);
if (m_Dead)
{
AddReward(-.001f);
AddReward(-.001f * m_Bonus);
}
Debug.Log(angle);
}

{
hit.collider.gameObject.GetComponent<LargeCubeAgent>().HitAgent();
AddReward(.001f);
AddReward(.001f * m_Bonus);
}
}
}

}
else // Dead
{
AddReward(-.1f);
AddReward(-.1f * m_Bonus);
m_Dead = true;
gameObject.tag = "DeadSmallAgent";
gameObject.GetComponentInChildren<Renderer>().material = deadMaterial;

HealthStatus();
m_Dead = false;
m_Shoot = false;
m_Bonus = Academy.Instance.FloatProperties.GetPropertyWithDefault("bonus", 0);
m_AgentRb.velocity = Vector3.zero;
myLaser.transform.localScale = new Vector3(0f, 0f, 0f);
float smallRange = 30f * m_MyArea.range;

7
config/curricula/cube_wars.yaml


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