Skip to content

Commit

Permalink
Merge pull request #3136 from matsim-org/total-weight-for-wrs
Browse files Browse the repository at this point in the history
Add getter for totalWeight to WeightedRandomSelection
  • Loading branch information
jfbischoff authored Mar 1, 2024
2 parents b78e7c7 + 97c94ba commit 923cfce
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public int size() {
return entryList.size();
}

public double getTotalWeight() {
return totalWeight;
}

private record Entry<E>(E e, double cumulativeWeight) implements Comparable<Entry<E>> {
public int compareTo(Entry<E> o) {
double diff = this.cumulativeWeight - o.cumulativeWeight;
Expand Down

0 comments on commit 923cfce

Please sign in to comment.