Skip to content

Commit

Permalink
fix(grid-dual-access): properly trigger with flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ansoncfit committed Mar 18, 2024
1 parent 81e0151 commit 3d60412
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public TravelTimeReducer (AnalysisWorkerTask task, TransportNetwork network) {
if (task.includePathResults) {
pathResult = new PathResult(task, network.transitLayer);
}
if (task.includeTemporalDensity || task.flags.contains("gridDualAccess")) {
if (task.includeTemporalDensity || task.hasFlag("gridDualAccess")) {
temporalDensityResult = new TemporalDensityResult(task);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,8 @@ public void validateCutoffsMinutes () {
}
}

public boolean hasFlag (String flag) {
return this.flags != null && this.flags.contains(flag);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ public RegionalWorkResult(OneOriginResult result, RegionalTask task) {
this.jobId = task.jobId;
this.taskId = task.taskId;
this.travelTimeValues = result.travelTimes == null ? null : result.travelTimes.values;
this.accessibilityValues = result.accessibility == null ? null : result.density.fakeDualAccess(task);
if (result.accessibility == null) {
this.accessibilityValues = null;
} else if (task.flags.contains("gridDualAccess")) {
this.accessibilityValues = result.density.fakeDualAccess(task);
} else {
this.accessibilityValues = result.accessibility.getIntValues();
}
this.pathResult = result.paths == null ? null : result.paths.summarizeIterations(PathResult.Stat.MINIMUM);
this.opportunitiesPerMinute = result.density == null ? null : result.density.opportunitiesPerMinute;
// TODO checkTravelTimeInvariants, checkAccessibilityInvariants to verify that values are monotonically increasing
Expand Down

0 comments on commit 3d60412

Please sign in to comment.