浏览代码

added existential penaalty to generic soccer agent

/asymm-envs
Andrew Cohen 4 年前
当前提交
23931551
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. 13
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs

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


public override void OnActionReceived(float[] vectorAction)
{
// Generic gets nothing
if (position == Position.Striker)
if (position == Position.Goalie)
// Existential penalty for Strikers.
AddReward(-1f / 3000f);
// Existential bonus for Goalies.
AddReward(1f / 3000f);
else if (position == Position.Goalie)
else
// Existential bonus for Goalies.
AddReward(1f / 3000f);
// Existential penalty for Strikers/Generic.
AddReward(-1f / 3000f);
}
MoveAgent(vectorAction);
}

正在加载...
取消
保存