psytask - v1.1.1
    Preparing search index...

    Class RandomSampling<T>

    for (const value of new RandomSampling({
    candidates: [1, 2, 3],
    sampleSize: 5,
    replace: true,
    })) {
    console.log(value);
    }
    for (const value of new RandomSampling({
    candidates: [1, 2, 3],
    sampleSize: 2,
    replace: false,
    })) {
    console.log(value);
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Type Parameters

      • T

      Parameters

      • options: { candidates: T[]; sampleSize?: number; replace?: boolean }
        • candidates: T[]

          Something to be sampled

        • OptionalsampleSize?: number

          Number of generated samples

          candidates.length
          
        • Optionalreplace?: boolean

          With or without replacement

          true
          

      Returns RandomSampling<T>

    Properties

    options: { candidates: T[]; sampleSize: number; replace: boolean }

    Methods