docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GenericMetric

    General metric class used to record simulation metrics. This class can report values of many primitive types along with any struct/class implementing the IMessageProducer interface. For most use cases, using this class will be suitable for metric reporting.

    Inheritance
    object
    DataModelElement
    Metric
    GenericMetric
    Implements
    IMessageProducer
    Inherited Members
    Metric.modelType
    Metric.sensorId
    Metric.annotationId
    DataModelElement.id
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.GroundTruth.DataModel
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    public class GenericMetric : Metric, IMessageProducer

    Constructors

    GenericMetric(bool, MetricDefinition, string, string)

    Creates a new metric containing a boolean value.

    Declaration
    public GenericMetric(bool value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    bool value

    The boolean metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(bool[], MetricDefinition, string, string)

    Creates a new metric containing an array of booleans.

    Declaration
    public GenericMetric(bool[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    bool[] values

    The boolean metric values

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(int, MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(int value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    int value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(int[], MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(int[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    int[] values

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(float, MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(float value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    float value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(float[], MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(float[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    float[] values

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(string, MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(string value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    string value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(string[], MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(string[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    string[] values

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(uint, MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(uint value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    uint value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(uint[], MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(uint[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    uint[] values

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(IMessageProducer, MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(IMessageProducer value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    IMessageProducer value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(IMessageProducer[], MetricDefinition, string, string)

    Creates a new metric.

    Declaration
    public GenericMetric(IMessageProducer[] values, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    IMessageProducer[] values

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    GenericMetric(Vector3, MetricDefinition, string, string)

    Creates a new float array metric from a vector3 value. The array will store the values as [x, y, z] in the array.

    Declaration
    public GenericMetric(Vector3 value, MetricDefinition definition, string sensorId = null, string annotationId = null)
    Parameters
    Type Name Description
    Vector3 value

    The metric value

    MetricDefinition definition

    The metric definition

    string sensorId

    The sensor ID, set as default for a metric not associated with a sensor

    string annotationId

    The annotation ID associated with this metric, set as default for a metric not associated to an annotation

    Methods

    GetValues<T>()

    Retrieves an array of the metric values.

    Declaration
    public override T[] GetValues<T>()
    Returns
    Type Description
    T[]

    Array of requested metrics

    Type Parameters
    Name Description
    T

    Any metric value based on IMessageProducer

    Overrides
    Metric.GetValues<T>()

    IsValid()

    Is the component valid?

    Declaration
    public override bool IsValid()
    Returns
    Type Description
    bool

    Is the component valid?

    Overrides
    DataModelElement.IsValid()

    ToMessage(IMessageBuilder)

    Convert contents int a message.

    Declaration
    public override void ToMessage(IMessageBuilder builder)
    Parameters
    Type Name Description
    IMessageBuilder builder

    The message builder that will convert the class's contents into a message

    Overrides
    Metric.ToMessage(IMessageBuilder)

    Implements

    IMessageProducer
    In This Article
    Back to top
    Copyright © 2024 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)