Procs
proc weighted_choice[T](options: seq[(int, T)]; rng: var MersenneTwister = mersenneTwisterInst): T
- Return a T from a seq[(int, T)] where the first item in each tuple specifies a relative likelyhood, or weight, of that item being selected.
proc weighted_selection[T](options: seq[(int, T)]; selection: float): T
- Return a T from a seq[(int, T)] based on the input selection. The selection is a float between 0.0 and 1.0. To determine the option to return a sum of all option weights is created. The selection value is mapped to the range of zero to the sum and the associated option is returned.
proc merge[K, V](d1: var Table[K, V]; d2: Table[K, V])