Method MarkovRandomInt
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
MarkovRandomInt(float[,])
Generates a Markov chain of integers from a transition table.
public static IGenerator<int> MarkovRandomInt(float[,] transitionTable)
Parameters
transitionTable
float[,]The transition table to use. The value in the table at [i][j] is the relative probability that i will be followed by j. Note that values in a row need not add to 1, the values are normalized per row. In each row, there must be at least one positive value. All values must be non-negative.
Returns
- IGenerator<int>
A new generator.
MarkovRandomInt(float[,], int)
Generates a Markov chain of integers from a transition table.
public static IGenerator<int> MarkovRandomInt(float[,] transitionTable, int seed)
Parameters
transitionTable
float[,]The transition table to use. The value in the table at [i][j] is the relative probability that i will be followed by j. Note that values in a row need not add to 1, the values are normalized per row. In each row, there must be at least one positive value. All values must be non-negative.
seed
intThe seed to use for the random number generator.
Returns
- IGenerator<int>
A new generator.