MCPcopy Create free account
hub / github.com/boxbeam/RedLib / fromDoubleMap

Method fromDoubleMap

src/redempt/redlib/misc/WeightedRandom.java:46–48  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

fromCollectionMethod · 0.95
fromStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected