Computes the sum of weights. Usually needs to add up to 100% @return The total weight
()
| 140 | * @return The total weight |
| 141 | */ |
| 142 | public double totalWeight() { |
| 143 | double total = 0.0; |
| 144 | for (Double d : weights) { |
| 145 | total += d; |
| 146 | } |
| 147 | return total; |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * This simply computes the next transaction by randomly selecting one based on the weights of |