markovChainLength function
Returns an integer linearly interpolated
between chainLengthStart
and chainLengthEnd
.
markovChainlength(tStart) = mStart
,markovChainlength(tEnd) = mEnd
.- The following must hold:
tStart <= temperature <= tEnd
.
Implementation
int markovChainLength(
num temperature, {
required num tStart,
required num tEnd,
int chainLengthStart = 5,
int chainLengthEnd = 20,
}) =>
((chainLengthStart - chainLengthEnd) *
(temperature - tStart) ~/
(tStart - tEnd) +
chainLengthStart);