浏览代码

address comments

/develop/superpush/int
Ruo-Ping Dong 4 年前
当前提交
0006cd7f
共有 4 个文件被更改,包括 7 次插入6 次删除
  1. 4
      com.unity.ml-agents.extensions/Runtime/Teams/BaseTeamManager.cs
  2. 4
      com.unity.ml-agents/Runtime/Academy.cs
  3. 4
      com.unity.ml-agents/Runtime/Agent.cs
  4. 1
      com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs

4
com.unity.ml-agents.extensions/Runtime/Teams/BaseTeamManager.cs


public BaseTeamManager()
{
Academy.Instance.TeamManagerStep += _ManagerStep;
Academy.Instance.PostAgentAct += _ManagerStep;
Academy.Instance.TeamManagerStep -= _ManagerStep;
Academy.Instance.PostAgentAct -= _ManagerStep;
}
void _ManagerStep()

4
com.unity.ml-agents/Runtime/Academy.cs


// This will mark the Agent as Done if it has reached its maxSteps.
internal event Action AgentIncrementStep;
internal event Action TeamManagerStep;
internal event Action PostAgentAct;
/// <summary>
/// Signals to all of the <see cref="Agent"/>s that their step is about to begin.

AgentAct?.Invoke();
}
TeamManagerStep?.Invoke();
PostAgentAct?.Invoke();
}
}

4
com.unity.ml-agents/Runtime/Agent.cs


m_CumulativeReward += increment;
}
public void SetTeamReward(float reward)
internal void SetTeamReward(float reward)
{
#if DEBUG
Utilities.DebugCheckNanAndInfinity(reward, nameof(reward), nameof(SetTeamReward));

public void AddTeamReward(float increment)
internal void AddTeamReward(float increment)
{
#if DEBUG
Utilities.DebugCheckNanAndInfinity(increment, nameof(increment), nameof(AddTeamReward));

1
com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs


var agentInfoProto = new AgentInfoProto
{
Reward = ai.reward,
TeamReward = ai.teamReward,
MaxStepReached = ai.maxStepReached,
Done = ai.done,
Id = ai.episodeId,

正在加载...
取消
保存