浏览代码

more team -> group

/MLA-1734-demo-provider
Ruo-Ping Dong 4 年前
当前提交
f3899bd2
共有 2 个文件被更改,包括 21 次插入9 次删除
  1. 15
      com.unity.ml-agents.extensions/Runtime/MultiAgent/BaseMultiAgentGroup.cs
  2. 15
      com.unity.ml-agents/Runtime/IMultiAgentGroup.cs

15
com.unity.ml-agents.extensions/Runtime/MultiAgent/BaseMultiAgentGroup.cs


namespace Unity.MLAgents.Extensions.MultiAgent
{
/// <summary>
/// A base class implementation of MultiAgentGroup.
/// </summary>
public class BaseMultiAgentGroup : IMultiAgentGroup, IDisposable
{
int m_StepCount;

public BaseMultiAgentGroup()
{
Academy.Instance.PostAgentAct += _ManagerStep;
Academy.Instance.PostAgentAct += _GroupStep;
Academy.Instance.PostAgentAct -= _ManagerStep;
Academy.Instance.PostAgentAct -= _GroupStep;
while (m_Agents.Count > 0)
{
UnregisterAgent(m_Agents[0]);

void _ManagerStep()
void _GroupStep()
{
m_StepCount += 1;
if ((m_StepCount >= m_GroupMaxStep) && (m_GroupMaxStep > 0))

}
}
/// <summary>
/// Get the ID of the MultiAgentGroup.
/// </summary>
/// <returns>
/// MultiAgentGroup ID.
/// </returns>
public int GetId()
{
return m_Id;

15
com.unity.ml-agents/Runtime/IMultiAgentGroup.cs


namespace Unity.MLAgents
{
/// <summary>
/// MultiAgentGroup interface for grouping agents to support multi-agent training.
/// </summary>
/// <summary>
/// Get the ID of MultiAgentGroup.
/// </summary>
/// <returns>
/// MultiAgentGroup ID.
/// </returns>
/// <summary>
/// Register agent to the MultiAgentGroup.
/// </summary>
/// <summary>
/// UnRegister agent from the MultiAgentGroup.
/// </summary>
void UnregisterAgent(Agent agent);
}
}
正在加载...
取消
保存