您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
936 B
34 行
936 B
using System.Collections.Generic;
|
|
using Unity.MLAgents;
|
|
using Unity.MLAgents.Sensors;
|
|
|
|
namespace Unity.MLAgents.Extensions.Teams
|
|
{
|
|
public class BaseTeamManager : ITeamManager
|
|
{
|
|
private readonly string m_Id = System.Guid.NewGuid().ToString();
|
|
|
|
public virtual void RegisterAgent(Agent agent)
|
|
{
|
|
|
|
}
|
|
|
|
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 AddTeamReward(float reward)
|
|
{
|
|
|
|
}
|
|
|
|
public string GetId()
|
|
{
|
|
return m_Id;
|
|
}
|
|
}
|
|
}
|