浏览代码

add base team manager

/develop/teammanager
Ruo-Ping Dong 4 年前
当前提交
e2451ce5
共有 4 个文件被更改,包括 25 次插入11 次删除
  1. 11
      com.unity.ml-agents.extensions/Runtime/Teams/BaseTeamManager.cs
  2. 2
      com.unity.ml-agents/Runtime/Agent.cs
  3. 12
      com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs
  4. 11
      com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs.meta

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


using System.Collections.Generic;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;
namespace Unity.MLAgents.Extensions.Teams
{
public class BaseTeamManager : ITeamManager

public virtual void OnAgentDone(Agent agent, Agent.DoneReason doneReason, List<ISensor> sensors)
{
// Possible implementation - save reference to Agent's IPolicy so that we can repeatedly
// call IPolicy.RequestDecision on behalf of the Agent after it's dead
// If so, we'll need dummy sensor impls with the same shape as the originals.
agent.SendDoneToTrainer();
}
public virtual void RegisterAgent(Agent agent) { }

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


ITeamManager m_TeamManager;
ITeamManager m_TeamManager;
/// <summary>
/// Called when the attached [GameObject] becomes enabled and active.
/// [GameObject]: https://docs.unity3d.com/Manual/GameObjects.html

12
com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs


using System.Collections.Generic;
using Unity.MLAgents.Sensors;
namespace Unity.MLAgents
{
public interface ITeamManager
{
int GetId();
void RegisterAgent(Agent agent);
}
}

11
com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs.meta


fileFormatVersion: 2
guid: 8b061f82569af4ffba715297f77a95ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存