pub fn mnl_select<R: Rng>(costs: &[f64], theta: f64, rng: &mut R) -> usizeExpand description
Select one alternative from a set of costs using the multinomial logit model.
§Arguments
costs- generalized cost of each alternative (lower = better)theta- scale parameter controlling dispersion. Larger θ means more deterministic (strongly favors lowest cost). Smaller θ means more random.rng- random number generator
§Returns
Index of the selected alternative in the costs slice.
§Edge cases
- If
costsis empty, returns0. - If
costshas one element, returns0. - If all utilities are degenerate (overflow/underflow), returns
0.