docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RpcCommunicator

    Inheritance
    object
    RpcCommunicator
    Implements
    ICommunicator
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    RpcCommunicator

    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
    Type Name Description
    string behaviorName
    int agentId

    A key to identify which Agent actions to get.

    Returns
    Type Description
    ActionBuffers

    ActionBuffers corresponding to the input key.

    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
    CommunicatorInitParameters initParameters

    The Unity Initialization Parameters to be sent.

    UnityRLInitParameters 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.

    AgentInfo 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.

    ActionSpec 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
    QuitCommandHandler

    ResetCommandReceived

    Reset command sent back from the communicator.

    Declaration
    public event ResetCommandHandler ResetCommandReceived
    Event Type
    Type Description
    ResetCommandHandler

    Implements

    ICommunicator
    IDisposable
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)