Method SampleRandom
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
SampleRandom<T>(IEnumerable<T>, int)
Returns a random sample from a source.
public static IEnumerable<T> SampleRandom<T>(this IEnumerable<T> source, int sampleCount)
Parameters
sourceIEnumerable<T>The source from which to sample.
sampleCountintThe number of samples to return.
Returns
- IEnumerable<T>
Generates a ransom subset from a given source.
Type Parameters
TThe type of elements of the source.
SampleRandom<T>(IEnumerable<T>, int, IRandom)
Returns a random sample from a source.
public static IEnumerable<T> SampleRandom<T>(this IEnumerable<T> source, int sampleCount, IRandom random)
Parameters
sourceIEnumerable<T>The source from which to sample.
sampleCountintThe number of samples to return.
randomIRandomThe random generator to use.
Returns
- IEnumerable<T>
Generates a ransom subset from a given source.
Type Parameters
TThe type of elements of the source.