Click or drag to resize

GeneratorFrequencyRandomInt Method (IEnumerableSingle, Int32)

Generates random integers at relative frequencies provided.

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public static IGenerator<int> FrequencyRandomInt(
	IEnumerable<float> frequencies,
	int seed
)

Parameters

frequencies
Type: System.Collections.GenericIEnumerableSingle
The relative frequencies of each integer. If the array of frequencies has three elements, then the integers produced will be 0, 1, 2 (provided all frequencies are positive). All frequencies must be non-negative, and at least one must be positive.
seed
Type: SystemInt32
A seed to use for the random number generator.

Return Value

Type: IGeneratorInt32
A new generator.
See Also