@@ -31,15 +31,15 @@ public CsvResultType resultType () {
31
31
public String [] columnHeaders () {
32
32
List <String > headers = new ArrayList <>();
33
33
// The ids of the freeform origin point and destination set
34
- headers .add ("originId " );
35
- headers .add ("destId " );
34
+ headers .add ("origin " );
35
+ headers .add ("destinations " );
36
36
headers .add ("percentile" );
37
+ // The number of minutes needed to reach d destination opportunities
38
+ headers .add ("D" + dualThreshold );
39
+ // The opportunity density during each of 120 minutes
37
40
for (int m = 0 ; m < 120 ; m += 1 ) {
38
- // The opportunity density over travel minute m
39
41
headers .add (Integer .toString (m ));
40
42
}
41
- // The number of minutes needed to reach d destination opportunities
42
- headers .add ("D" + dualThreshold );
43
43
return headers .toArray (new String [0 ]);
44
44
}
45
45
@@ -67,20 +67,24 @@ public Iterable<String[]> rowValues (RegionalWorkResult workResult) {
67
67
List <String > row = new ArrayList <>(125 );
68
68
row .add (originId );
69
69
row .add (task .destinationPointSetKeys [d ]);
70
- row .add (Integer .toString (p ));
71
- // One density value for each of 120 minutes
70
+ row .add (Integer .toString (task . percentiles [ p ] ));
71
+ // One column containing dual accessibility value
72
72
double [] densitiesPerMinute = percentilesForDestPointset [p ];
73
- for (int m = 0 ; m < 120 ; m ++) {
74
- row .add (Double .toString (densitiesPerMinute [m ]));
75
- }
76
- // One dual accessibility value
77
73
int m = 0 ;
78
74
double sum = 0 ;
75
+ // Find smallest integer M such that we have already reached D destinations after M minutes of travel.
79
76
while (sum < dualThreshold && m < 120 ) {
80
77
sum += densitiesPerMinute [m ];
81
78
m += 1 ;
82
79
}
80
+ // -1 indicates the threshold number of opportunities had still not been reached after the highest
81
+ // travel time cutoff specified in the analysis.
83
82
row .add (Integer .toString (m >= 120 ? -1 : m ));
83
+ // One density value for each of 120 one-minute bins.
84
+ // Column labeled 10 contains the number of opportunities reached after 10 to 11 minutes of travel.
85
+ for (int m = 0 ; m < 120 ; m ++) {
86
+ row .add (Double .toString (densitiesPerMinute [m ]));
87
+ }
84
88
rows .add (row .toArray (new String [row .size ()]));
85
89
}
86
90
}
0 commit comments