We could allow #[P = 0.45] annotations to allow setting the probabilities for enum variants. The variants without annotations divide the remaining probability under themselves.
We should raise an error if the sum of probabilities is greater than 1.
I came here to say this. Or almost this—I prefer integer weights (defaulting to 1) because I find it easier to adjust them independently. It wouldn't be difficult to support both.
We could allow
#[P = 0.45]
annotations to allow setting the probabilities for enum variants. The variants without annotations divide the remaining probability under themselves.We should raise an error if the sum of probabilities is greater than 1.