docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FloatPropertiesChannel

    Side channel that is comprised of a collection of float variables.

    Inheritance
    object
    SideChannel
    FloatPropertiesChannel
    Inherited Members
    SideChannel.ChannelId
    SideChannel.QueueMessageToSend(OutgoingMessage)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MLAgents.SideChannels
    Assembly: Unity.ML-Agents.dll
    Syntax
    public class FloatPropertiesChannel : SideChannel

    Constructors

    FloatPropertiesChannel(Guid)

    Initializes the side channel with the provided channel ID.

    Declaration
    public FloatPropertiesChannel(Guid channelId = default)
    Parameters
    Type Name Description
    Guid channelId

    ID for the side channel.

    Methods

    GetWithDefault(string, float)

    Get an Environment property with a default value. If there is a value for this property, it will be returned, otherwise, the default value will be returned.

    Declaration
    public float GetWithDefault(string key, float defaultValue)
    Parameters
    Type Name Description
    string key

    The string identifier of the property.

    float defaultValue

    The default value of the property.

    Returns
    Type Description
    float

    The parameter value associated with the provided key.

    Keys()

    Returns a list of all the string identifiers of the properties currently present.

    Declaration
    public IList<string> Keys()
    Returns
    Type Description
    IList<string>

    The list of string identifiers

    OnMessageReceived(IncomingMessage)

    Is called by the communicator every time a message is received from Python by the SideChannel. Can be called multiple times per simulation step if multiple messages were sent.

    Declaration
    protected override void OnMessageReceived(IncomingMessage msg)
    Parameters
    Type Name Description
    IncomingMessage msg

    The incoming message.

    Overrides
    SideChannel.OnMessageReceived(IncomingMessage)

    RegisterCallback(string, Action<float>)

    Registers an action to be performed everytime the property is changed.

    Declaration
    public void RegisterCallback(string key, Action<float> action)
    Parameters
    Type Name Description
    string key

    The string identifier of the property.

    Action<float> action

    The action that ill be performed. Takes a float as input.

    Set(string, float)

    Sets one of the float properties of the environment. This data will be sent to Python.

    Declaration
    public void Set(string key, float value)
    Parameters
    Type Name Description
    string key

    The string identifier of the property.

    float value

    The float value of the property.

    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)