The model used the 2012 Household Travel Survey to calibrate trip lengths for internal and external person trips. Trips were calibrated based on generalized cost trip length frequencies and validated to time and distance trip length frequencies and average trip lengths. The validation results are shown in Figure 1 and Figure 2 . Trip lengths by time and distance met the validation targets and aligned closely with observed data.
No observed data was available for internal and external truck calibration. Truck trips were calibrated based on previous model estimation and validated relative to person work and other trip lengths.
Average Trip Length Validation
Code
viewof varSelect = Inputs. select (new Map ([['Generalized Cost' , 'GC' ], ['Distance' , 'Dist' ], ['Time' , 'Time' ]]), {value : 'Variable' , label : "Variable" })
viewof purpSelect = Inputs. select (new Map ([['Internal Trip Purposes' , 'MainPurposes' ], ['External Trip Purposes' , 'Externals' ]]), {value : 'PurpType' , label : "Purpose Set" });
Code
dataLT = transpose (dataStats)
filtered_data = dataLT. filter (function (dataL) {
return varSelect == dataL. Variable &&
purpSelect == dataL. PurpType ;
})
Code
import {Legend, Swatches} from "@d3/color-legend"
import {howto, altplot} from "@d3/example-components"
Code
Plot. plot ({
y : {axis : null },
x : {tickFormat : "s" , grid : true },
color : {
domain : ["Model" , "Observed" ],
range : ["#376092" , "#77933c" ],
legend : true
},
facet : {
data : filtered_data,
y : "Purpose" ,
label : null ,
marginLeft : 95 ,
marginTop : 4 ,
marginBottom : 4
},
style : {fontSize : 16 },
marginTop : 10 ,
marginBottom : 40 ,
marginRight : 40 ,
marginLeft : 95 ,
height : filtered_data. length * 22 ,
marks : [
Plot. barX (filtered_data, {
y : "DataSource" ,
x : "AVG_TRIP_LEN" ,
fill : "DataSource"
}),
Plot. ruleX ([0 ])
]
})
Code
Inputs. table (filtered_data)
Trip Length Frequency Validation
The following trip length frequency charts have been updated to exclude intrazonal trips. The distance charts only include data beyond 0, the time charts only include data beyond 4, and the general cost charts only include data beyond 4. Please note that these values were calculated at a mark where the majority of the trip would not be intrazonal trips. Intrazonal trips were analyzed separately.
Code
optionsTripPurp =
[
['Home-Based Work' , 'HBW' ],
['Home-Based Shopping' , 'HBShp' ],
['Home-Based Other' , 'HBOth' ],
['Home-Based School - Primary' , 'HBSchPr' ],
['Home-Based School - Secondary' , 'HBSchSc' ],
['Non-Home-Based Work' , 'NHBW' ],
['Non-Home-Based Non-Work' , 'NHBNW' ],
['Light Trucks' , 'LT' ],
['Medium Trucks' , 'MD' ],
['Heavy Trucks' , 'HV' ],
['Internal-to-External' , 'IX' ],
['External-to-Internal' , 'XI' ]
]
viewof vTripPurp = Inputs. select (new Map (optionsTripPurp), {value : 'HBW' , label : "Trip Purpose:" })
viewof vTlfType = Inputs. select (new Map ([['Generalized Cost' , 'GC' ], ['Distance' , 'Dist' ], ['Time' , 'Time' ]]), {value : 'GC' , label : "Variable:" })
Code
freqT = transpose (freq)
freqT_filtered_Obs = freqT. filter (function (freqData) {
return vTripPurp == freqData. TRIPPURP &&
vTlfType == freqData. TLFTYPE &&
'freqObs' == freqData. freqSource ;
})
freqT_filtered_Mod = freqT. filter (function (freqData) {
return vTripPurp == freqData. TRIPPURP &&
vTlfType == freqData. TLFTYPE &&
'freqMod' == freqData. freqSource ;
})
Code
colorScale = d3. scaleOrdinal ()
. domain (["Model" , "Observed" ])
. range (["#376092" , "#77933c" ]);
key2 = Legend (colorScale, {title : "Data Source" })
Code
dataX = transpose (xvals)
filtered_x = dataX. filter (function (dx) {
return vTripPurp == dx. Purpose &&
vTlfType == dx. TLF ;
})
maxXValue = Math . max (... filtered_x. map (function (dx){
return dx. maxX ;
}));
minXValue = Math . max (... filtered_x. map (function (dx){
return dx. minX ;
}));
Code
Plot. plot ({
grid : true ,
height : 420 , // << this is the key fix
x : {
label : 'Distance / Time / Cost' ,
domain : [minXValue, maxXValue] // <-- force start at 4 to exclude intrazonals
},
y : {
label : 'Frequency' ,
tickFormat : f => ` ${ Math . round (f * 100 )} %`
},
marginRight : 40 ,
marginLeft : 60 ,
marginTop : 40 ,
marginBottom : 50 ,
style : { fontSize : 15 },
marks : [
Plot. line (freqT_filtered_Mod, {
x : 'BIN' ,
y : 'freq' ,
stroke : "#376092" ,
strokeWidth : 3
}),
Plot. line (freqT_filtered_Obs, {
x : 'BIN' ,
y : 'freq' ,
stroke : "#77933c" ,
strokeWidth : 3
}),
Plot. frame ({ strokeOpacity : 0.2 })
]
});
Intrazonal Trip Percentage
Code
dataIntraT = transpose (dataIntra)
Code
Plot. plot ({
y : {axis : null },
x : {tickFormat : "s" , grid : true },
color : {
domain : ["Model" , "Observed" ],
range : ["#376092" , "#77933c" ],
legend : true
},
facet : {
data : dataIntraT,
y : "PURP" ,
label : null ,
marginLeft : 95 ,
marginTop : 4 ,
marginBottom : 4
},
style : {fontSize : 16 },
marginTop : 10 ,
marginBottom : 40 ,
marginRight : 40 ,
marginLeft : 95 ,
height : dataIntraT. length * 22 ,
marks : [
Plot. barX (dataIntraT, {
y : "DataSource" ,
x : "pct_intrazonal" ,
fill : "DataSource"
}),
Plot. ruleX ([0 ])
]
})