Ruo-Ping Dong
4 年前
当前提交
6f0bb2a4
共有 15 个文件被更改,包括 96 次插入 和 112 次删除
-
25com.unity.ml-agents.extensions/Runtime/Teams/BaseTeamManager.cs
-
32com.unity.ml-agents/Runtime/Agent.cs
-
1com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
-
26com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects/AgentInfo.cs
-
24ml-agents-envs/mlagents_envs/base_env.py
-
6ml-agents-envs/mlagents_envs/communicator_objects/agent_info_pb2.py
-
5ml-agents-envs/mlagents_envs/communicator_objects/agent_info_pb2.pyi
-
23ml-agents-envs/mlagents_envs/rpc_utils.py
-
2protobuf-definitions/proto/mlagents_envs/communicator_objects/agent_info.proto
-
12com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs
-
11com.unity.ml-agents/Runtime/Actuators/ITeamManager.cs.meta
-
13com.unity.ml-agents/Runtime/TeamManagerIdCounter.cs
-
11com.unity.ml-agents/Runtime/TeamManagerIdCounter.cs.meta
-
14com.unity.ml-agents/Runtime/ITeamManager.cs
-
3com.unity.ml-agents/Runtime/ITeamManager.cs.meta
|
|||
using System.Collections.Generic; |
|||
using Unity.MLAgents; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
private readonly string m_Id = System.Guid.NewGuid().ToString(); |
|||
readonly int m_Id = TeamManagerIdCounter.GetTeamManagerId(); |
|||
public virtual void RegisterAgent(Agent agent) |
|||
{ |
|||
} |
|||
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() |
|||
public int GetId() |
|||
{ |
|||
return m_Id; |
|||
} |
|
|||
using System.Collections.Generic; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
namespace Unity.MLAgents |
|||
{ |
|||
public interface ITeamManager |
|||
{ |
|||
int GetId(); |
|||
|
|||
void RegisterAgent(Agent agent); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8b061f82569af4ffba715297f77a95ab |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Threading; |
|||
|
|||
namespace Unity.MLAgents |
|||
{ |
|||
internal static class TeamManagerIdCounter |
|||
{ |
|||
static int s_Counter; |
|||
public static int GetTeamManagerId() |
|||
{ |
|||
return Interlocked.Increment(ref s_Counter); ; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 06456db1475d84371b35bae4855db3c6 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections.Generic; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
namespace Unity.MLAgents |
|||
{ |
|||
public interface ITeamManager |
|||
{ |
|||
string GetId(); |
|||
|
|||
void RegisterAgent(Agent agent); |
|||
// TODO not sure this is all the info we need, maybe pass a class/struct instead.
|
|||
void OnAgentDone(Agent agent, Agent.DoneReason doneReason, List<ISensor> sensors); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 75810d91665e4477977eb78c9b15aeb3 |
|||
timeCreated: 1610057818 |
撰写
预览
正在加载...
取消
保存
Reference in new issue