Class RpcCommunicator
Inherited Members
Namespace: Unity.MLAgents
Assembly: Unity.ML-Agents.dll
Syntax
public class RpcCommunicator : ICommunicator, IDisposable
Constructors
RpcCommunicator()
Initializes a new instance of the RPCCommunicator class.
Declaration
protected RpcCommunicator()
Methods
Create()
Declaration
public static RpcCommunicator Create()
Returns
Type | Description |
---|---|
Rpc |
DecideBatch()
Signals the ICommunicator that the Agents are now ready to receive their action and that if the communicator has not yet received an action for one of the Agents it needs to get one at this point.
Declaration
public void DecideBatch()
Dispose()
Close the communicator gracefully on both sides of the communication.
Declaration
public void Dispose()
GetActions(string, int)
Gets the AgentActions based on the batching key.
Declaration
public ActionBuffers GetActions(string behaviorName, int agentId)
Parameters
Returns
Type | Description |
---|---|
Action |
|
Initialize(CommunicatorInitParameters, out UnityRLInitParameters)
Sends the initialization parameters through the Communicator. Is used by the academy to send initialization parameters to the communicator.
Declaration
public bool Initialize(CommunicatorInitParameters initParameters, out UnityRLInitParameters initParametersOut)
Parameters
Type | Name | Description |
---|---|---|
Communicator |
initParameters | The Unity Initialization Parameters to be sent. |
Unity |
initParametersOut | The External Initialization Parameters received. |
Returns
Type | Description |
---|---|
bool | Whether the connection was successful. |
PutObservations(string, AgentInfo, List<ISensor>)
Sends the observations of one Agent.
Declaration
public void PutObservations(string behaviorName, AgentInfo info, List<ISensor> sensors)
Parameters
Type | Name | Description |
---|---|---|
string | behaviorName | Batch Key. |
Agent |
info | Agent info. |
List<ISensor> | sensors | Sensors that will produce the observations |
SubscribeBrain(string, ActionSpec)
Adds the brain to the list of brains which will be sending information to External.
Declaration
public void SubscribeBrain(string brainKey, ActionSpec actionSpec)
Parameters
Type | Name | Description |
---|---|---|
string | brainKey | Brain key. |
Action |
actionSpec | Description of the actions for the Agent. |
Events
QuitCommandReceived
Quit was received by the communicator.
Declaration
public event QuitCommandHandler QuitCommandReceived
Event Type
Type | Description |
---|---|
Quit |
ResetCommandReceived
Reset command sent back from the communicator.
Declaration
public event ResetCommandHandler ResetCommandReceived
Event Type
Type | Description |
---|---|
Reset |