权重随机算法
int weightSum = 0;
for (Item item : mItems) {
weightSum += item.getWeight();
}
if (weightSum <= 0) {
return null;
}
Random random = new Random();
int randomNum = random.nextInt(weightSum);
Integer m = 0;
for (Item item : mItems) {
if (m <= randomNum && randomNum < m + item.getWeight()) {
return item;
}
m += item.getWeight();
}