Skip to content
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

Merged
merged 32 commits into from
Dec 31, 2018
Merged

Conversation

rajnikantsh
Copy link
Collaborator

@rajnikantsh rajnikantsh commented Dec 26, 2018

Fixed #1084
add summary stats for averageVehicleDelayPerTrip and averageRidehailWaitTime


This change is Reviewable

@ghost ghost assigned rajnikantsh Dec 26, 2018
@ghost ghost added the Review label Dec 26, 2018
Copy link
Collaborator

@JustinPihony JustinPihony left a 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();
Copy link
Collaborator

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);
}};

Copy link
Collaborator Author

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")){
Copy link
Collaborator

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.

Copy link
Collaborator

@wrashid wrashid Dec 27, 2018

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

@JustinPihony JustinPihony dismissed their stale review December 27, 2018 18:48

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.

@JustinPihony
Copy link
Collaborator

To be clear - the code LGTM, but @wrashid will have to check if it's what he asked

@ghost ghost assigned wrashid Dec 27, 2018
@ghost ghost assigned zishanbilal Dec 28, 2018
@zishanbilal zishanbilal requested review from zishanbilal and removed request for zishanbilal December 28, 2018 02:13
@zishanbilal zishanbilal merged commit 067a827 into master Dec 31, 2018
@ghost ghost removed the Review label Dec 31, 2018
@zishanbilal zishanbilal deleted the rajnikantsh/#1084-add-misc-summarystats-4ci branch December 31, 2018 19:53
colinsheppard pushed a commit that referenced this pull request Jan 7, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants