浏览代码

default behavior for baseTeamManager

/develop/centralizedcritic/counterfact
Ruo-Ping Dong 4 年前
当前提交
6b486c78
共有 3 个文件被更改,包括 12 次插入14 次删除
  1. 5
      Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs
  2. 15
      Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayTeamManager.cs
  3. 6
      com.unity.ml-agents.extensions/Runtime/Teams/BaseTeamManager.cs

5
Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs


using System.Collections;
using Unity.MLAgents;
using Unity.MLAgents.Extensions.Teams;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;

base.Initialize();
if (isSpotter)
{
var teamManager = new HallwayTeamManager();
var teamManager = new BaseTeamManager();
SetTeamManager(teamManager);
teammate.SetTeamManager(teamManager);
}

15
Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayTeamManager.cs


{
List<Agent> m_AgentList = new List<Agent> { };
public override void OnAgentDone(Agent agent, Agent.DoneReason doneReason, List<ISensor> sensors)
{
agent.SendDoneToTrainer();
}
// public override void OnAgentDone(Agent agent, Agent.DoneReason doneReason, List<ISensor> sensors)
// {
// }
public override void AddTeamReward(float reward)
{
// public override void AddTeamReward(float reward)
// {
}
// }
}

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


{
public class BaseTeamManager : ITeamManager
{
readonly string m_Id = System.Guid.NewGuid().ToString();
private readonly string m_Id = System.Guid.NewGuid().ToString();
throw new System.NotImplementedException();
}
public virtual void OnAgentDone(Agent agent, Agent.DoneReason doneReason, List<ISensor> sensors)

// If so, we'll need dummy sensor impls with the same shape as the originals.
throw new System.NotImplementedException();
agent.SendDoneToTrainer();
}
public virtual void AddTeamReward(float reward)

正在加载...
取消
保存