Create a new WeightedRandom from a map of outcomes to their weights @param map The map of outcomes to their weights @param The type of the outcomes @return A WeightedRandom which can be used to roll for the given outcome
(Map<T, Double> map)
| 44 | * @return A WeightedRandom which can be used to roll for the given outcome |
| 45 | */ |
| 46 | public static <T> WeightedRandom<T> fromDoubleMap(Map<T, Double> map) { |
| 47 | return new WeightedRandom<T>(map, false); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Creates a WeightedRandom from a collection |
no outgoing calls
no test coverage detected