docs.unity3d.com
    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)
    Namespace: Unity.MLAgents.SideChannels
    Syntax
    public class FloatPropertiesChannel : SideChannel

    Constructors

    FloatPropertiesChannel(Guid)

    Initializes the side channel with the provided channel ID.

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

    ID for the side channel.

    Methods

    GetWithDefault(String, Single)

    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.

    Single defaultValue

    The default value of the property.

    Returns
    Type Description
    Single

    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<Single>)

    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<Single> action

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

    Set(String, Single)

    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.

    Single value

    The float value of the property.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023