Skip to main content
The Deno 2 Release Candidate is here
Learn more
method ProbabilityObjectArray.prototype.maxProbability
import { ProbabilityObjectArray } from "https://deno.land/x/sptaki@1.2.0/utils/RandomUtil.d.ts";

Get the maximum relative probability out of a ProbabilityObjectArray

Example: po = new ProbabilityObjectArray(new ProbabilityObject("a", 5), new ProbabilityObject("b", 1)) po.maxProbability() // returns 5

Returns

number

the maximum value of all relative probabilities in this ProbabilityObjectArray