dimanche 21 février 2016

Java probability, HashMap (Java 7)

Hello i've a hashmap with this value :

[11:18:06]: ITEM : LEATHER_LEGGINGS  |  PROBABILITY : 0.21

[11:18:06]: ITEM : DIAMOND_BOOTS     |  PROBABILITY : 0.30

[11:18:06]: ITEM : DIAMOND_SWORD     |  PROBABILITY : 0.45

[11:18:06]: ITEM : CHAINMAIL_BOOTS   |  PROBABILITY : 0.52

[11:18:06]: ITEM : ENCHANTED_BOOK    |  PROBABILITY : 0.20

[11:18:06]: ITEM : ENCHANTED_BOOK    |  PROBABILITY : 0.10

This is a Hashmap with <ItemStack, Double>

Double = the probability.

And now i search to execute this probability to sort a item of this list and by influencing the result with the probability.




Aucun commentaire:

Enregistrer un commentaire