浏览代码

only call EndEpisode() on killed agent

/develop/cc-teammanager
Ruo-Ping Dong 4 年前
当前提交
30001703
共有 1 个文件被更改,包括 2 次插入10 次删除
  1. 12
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs

12
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs


//Kill/disable an agent
public void KillAgent(Collision col, Transform t)
{
print($"zombie {t.name} ate {col.collider.name}");
//End Episode
foreach (var item in AgentsList)
{
if (!item.Agent)
{
return;
}
item.Agent.EndEpisode();
}
print($"Zombie {t.gameObject.GetInstanceID()} ate Agent {col.gameObject.GetInstanceID()}");
//Disable killed Agent
foreach (var item in AgentsList)

item.Agent.EndEpisode();
item.Col.gameObject.SetActive(false);
break;
}

正在加载...
取消
保存