frequency function

Arbitrary frequency(
  1. List<(int, Arbitrary)> arbitraries
)

Returns an arbitrary that generates values based on weighted probabilities.

The probability of selecting each arbitrary is proportional to its weight relative to the total weight.

Parameters:

  • arbitraries: The list of pairs of weights and arbitraries.

Implementation

Arbitrary<dynamic> frequency(List<(int, Arbitrary<dynamic>)> arbitraries) =>
    FrequencyArbitraries.frequency(arbitraries);