INNER CODE UNIT · Go

randN

mb-14/gomarkov · gomarkov.go:143

	randN := prng.Intn(sum)
	keys := arr.orderedKeys()
	for _, key := range keys {
		freq := arr[key]
		randN -= freq
		if randN <= 0 {
			return chain.statePool.intMap[key], nil
		}
	}
	return "", nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…