docs.unity3d.com
    Show / Hide Table of Contents

    Class WeightedMovingAverage

    Inheritance
    Object
    WeightedMovingAverage
    Namespace: Unity.Networking.QoS
    Syntax
    public class WeightedMovingAverage

    Constructors

    WeightedMovingAverage(Int32, Single)

    Declaration
    public WeightedMovingAverage(int numResults, float weightOfCurrentResult)
    Parameters
    Type Name Description
    Int32 numResults
    Single weightOfCurrentResult

    Properties

    WeightedResult

    Declaration
    public QosStatsResult WeightedResult { get; }
    Property Value
    Type Description
    QosStatsResult

    Methods

    AllResults()

    Get a copy of all stored results (unweighted)

    Declaration
    public IList<QosStatsResult> AllResults()
    Returns
    Type Description
    IList<QosStatsResult>

    Copy of the stored results as a list, or null if there is no stored results.

    AllResults(out QosStatsResult[])

    Get a copy of all stored results (unweighted)

    Declaration
    public void AllResults(out QosStatsResult[] results)
    Parameters
    Type Name Description
    QosStatsResult[] results

    out param containing copy of results

    Remarks
    • results can be null if no results have been added.

    ProcessResult(QosStatsResult, Boolean)

    Declaration
    public void ProcessResult(QosStatsResult result, bool updateAfterAdd = false)
    Parameters
    Type Name Description
    QosStatsResult result
    Boolean updateAfterAdd

    Update()

    Update the weighted moving average for the available results.

    Declaration
    public void Update()
    Remarks

    Results are stored in WeightedResult if there are results to compute.

    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