浏览代码

Agents get disabled when they die

/develop/cubewars/splashdamage
Ervin Teng 4 年前
当前提交
de1e377f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/SmallCubeAgent.cs

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


public override void CollectObservations(VectorSensor sensor)
{
sensor.AddObservation(System.Convert.ToInt32(m_Shoot));
sensor.AddObservation(System.Convert.ToInt32(m_Dead));
sensor.AddObservation(m_HitPoints);
// Direction big agent is looking
Vector3 dirToSelf = transform.position - m_LargeAgent.transform.position;

}
else // Dead
{
AddReward(-.1f * m_Bonus);
// AddReward(-.1f * m_Bonus);
EndEpisode();
gameObject.SetActive(false);
gameObject.tag = "DeadSmallAgent";
myBody.GetComponentInChildren<Renderer>().material = deadMaterial;
m_MyArea.AgentDied();

public override void OnEpisodeBegin()
{
gameObject.SetActive(true);
m_HitPoints = 1f;
HealthStatus();
m_Dead = false;

正在加载...
取消
保存