Interface ISampler | Perception | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Interface ISampler

    Generates random values from probability distributions

    Namespace: UnityEngine.Experimental.Perception.Randomization.Samplers
    Syntax
    public interface ISampler

    Properties

    baseSeed

    The base seed used to initialize this sampler's state

    Declaration
    uint baseSeed { get; set; }
    Property Value
    Type Description
    UInt32

    range

    A range bounding the values generated by this sampler

    Declaration
    FloatRange range { get; set; }
    Property Value
    Type Description
    FloatRange

    state

    The current random state of this sampler

    Declaration
    uint state { get; set; }
    Property Value
    Type Description
    UInt32

    Methods

    IterateState(Int32)

    Deterministically offsets a sampler's state when generating values within a batched job

    Declaration
    void IterateState(int offsetIndex)
    Parameters
    Type Name Description
    Int32 offsetIndex

    The index used to offset the sampler's state. Typically set to either the current scenario iteration or a job's batch index.

    ResetState()

    Resets a sampler's state to its base random seed

    Declaration
    void ResetState()

    Sample()

    Generates one sample

    Declaration
    float Sample()
    Returns
    Type Description
    Single

    The generated sample

    Samples(Int32, out JobHandle)

    Schedules a job to generate an array of samples

    Declaration
    NativeArray<float> Samples(int sampleCount, out JobHandle jobHandle)
    Parameters
    Type Name Description
    Int32 sampleCount

    The number of samples to generate

    JobHandle jobHandle

    The handle of the scheduled job

    Returns
    Type Description
    NativeArray<Single>

    A NativeArray of generated samples

    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