docs.unity3d.com
    Show / Hide Table of Contents

    Class RandomUtils

    This class provide different random distribution function.

    Inheritance
    Object
    RandomUtils
    Namespace: Mechatronics.SensorSDK
    Syntax
    public class RandomUtils

    Fields

    rand

    A uniform random distribution.

    Declaration
    public static Random rand
    Field Value
    Type Description
    Random

    Methods

    NormalRandom(Single)

    Generate a normal distributed random numbers from a uniform distribution.

    Declaration
    public static float NormalRandom(float stdDeviation)
    Parameters
    Type Name Description
    Single stdDeviation
    Returns
    Type Description
    Single

    Permutation(Int32)

    Generates a permutation of the integers from 0 to n-1.

    Declaration
    public static int[] Permutation(int n)
    Parameters
    Type Name Description
    Int32 n

    Size of the permutation array to generate

    Returns
    Type Description
    Int32[]

    Permutation array

    Remarks

    Uses Knuth/Fisher-Yates shuffles: https://en.wikipedia.org/wiki/Random_permutation#Fisher-Yates_shuffles

    PoissonRandom(Double)

    Sample from a poisson distribution Code from: https://www.johndcook.com/blog/csharp_poisson/

    Declaration
    public static float PoissonRandom(double lambda)
    Parameters
    Type Name Description
    Double lambda

    mean of the distribution

    Returns
    Type Description
    Single

    Sample taken from Poisson(lambda)

    Back to top
    Terms of use
    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