-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add misc summary stats #1085
add misc summary stats #1085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is vague, so I'll let Rashid be the final check on if these are the stats he wanted. But the possible NPE is a blocker in itself.
@@ -216,6 +217,13 @@ public void createGraph(IterationEndsEvent event) throws IOException { | |||
writeRideHailWaitingIndividualStatCSV(event.getIteration()); | |||
} | |||
|
|||
@Override | |||
public Map<String, Double> getSummaryStats(){ | |||
Map<String, Double> averageRidehailWaitTime = new HashMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just one lining this:
return new HashMap<String, Double>() {{
put("averageRidehailWaitTime" , waitTimeSum / rideHailCount);
}};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JustinPihony, I have made this change.
@@ -20,19 +30,47 @@ public void processStats(Event event) { | |||
Double.parseDouble(eventAttributes.get(PathTraversalEvent.ATTRIBUTE_DEPARTURE_TIME))); | |||
|
|||
secondsTraveledByVehicleType.merge(vehicleType, hoursTraveled, (d1, d2) -> d1 + d2); | |||
|
|||
|
|||
if (vehicleType.contains("Car") || vehicleType.contains("BUS")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a number of different ways to handle something like this. @colinsheppard is there something I missed, or should I open an issue to try to create a static way to check vehicle type? Probably from BeamVehicleType.scala. This code is fine atm - I'm just using it as a reference point at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode should have been compared here @rajnikantsh, not vehicleType
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
Changes have been - made, but leaving the approval to Rashid since I can't tell from the issue whether the intended implementation is what is wanted.
To be clear - the code LGTM, but @wrashid will have to check if it's what he asked |
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
src/main/java/beam/analysis/summary/VehicleTravelTimeAnalysis.java
Outdated
Show resolved
Hide resolved
* add misc summary stats (#1085) * add misc summary stats * add null check and change return syntax * refactoring * bug fix: wrong field used * refactor: reuse code * add totalHoursOfVehicleTrafficDelay in summary stats. * add summary stats for averagePTWaitingTime * add bus crowding in summary stats * reset bus crowding * add averageTripExpenditure in summary stats * fixed cost aggregation * fixed PTCrowding (bus) * renamed to totalNetCost * fixed warnings * reset ptWaiting against personId * fixed average and update labels * hoursTraveled should be renamed to travelDurationInSec, as this is not in hours * remove / 3600 for busCrowding * fixed hard coding of modes * fixed hard coding of modes * rename _person * fixed warnings and format * create summary stats for average vehicle delay for motorized leg. (#1095) * fixed numOfTimesBusTaken in busCrowding * changed buses list to set * fixed averageVehicleDelay * fixed delay stat variable name * fixed delay stats calculation * fix n/0 issue * fix totalVehicles for averageDelays * fix failing run for sf-light scenario (#1097) * fix sf-light run * fix comment * can give too much logging when vehicles misconfigured so make exponential * Cs/#1099 rhm batch and repos (#1104) * initial attempt to enable co-execution of these processes, still buggy * debugging * found bug related to new requests coming in while buffered requests being processed, more robust now * fixing regression * another glitch solved * finally getting simultaneous timeouts working * fmt * allow pass when not in batch mode * ignore failing test * debug statements mistakently lefts as info * summary stats modification (#1110) * Merge remote-tracking branch 'remotes/origin/master' into rajnikantsh/#1008-extract-matsim-conf-4ci # Conflicts: # test/input/sf-light/sf-light-1k.conf add averageVehicleTravelPerPassengerTrip and averageTravelExpenditure for each activity * changed variable name * Cs/#1082 refine analysis (#1109) * turns into case objects, change delay metric bins * change delay metric plot (#1083) * change plot for delay metric * Scala fmt * resolved average delay graph issue * more descriptive titles * space * debugging non-deterministic stuck issue * fmt * repairing the fallback BeamPath used for transit trips that can't be … (#1106) * repairing the fallback BeamPath used for transit trips that can't be routed to avoid exceptions later on (cherry picked from commit 2cd4bdc) * scalafmt * ignore flaky test. * Cs/#1100 Refactor (#1113) * decompose some code from RHM into new class to clear things a bit * fmt * clean * extract matsim properties from beam.conf to matsim.conf (#1061) * extract matsim properties from beam.conf to matsim.conf * fmt * set param in beam config and referred in matsim config * renaming and moving * better default for iters * remaining changes in extracting matsim config * Merge remote-tracking branch 'remotes/origin/master' into rajnikantsh/#1008-extract-matsim-conf-4ci # Conflicts: # test/input/sf-light/sf-light-1k.conf reset agent number in sf-light-2.5k * renaming and reogranizing params * renaming and repositioning of sf-light * fmt * extract matsim from base conf * Merge branch 'master' into rajnikantsh/1115-extract-baseconf-4ci
Fixed #1084
add summary stats for averageVehicleDelayPerTrip and averageRidehailWaitTime
This change is