Skip to content

Commit e768c08

Browse files
authored
Merge pull request #16 from ActivitySim/veh_allocation_sh_compile_fix
Integer encoding vehicle allocation spec
2 parents a3da8bd + c3efd7a commit e768c08

File tree

2 files changed

+92
-84
lines changed

2 files changed

+92
-84
lines changed

ext-configs/vehicle_allocation.csv

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,97 @@ util_alt2_unavail,Household does not own vehicle,"veh_num2.isna() | (veh_num2 ==
55
util_alt3_unavail,Household does not own vehicle,"veh_num3.isna() | (veh_num3 == '')",0,0,coef_unavail,0,0
66
util_alt4_unavail,Household does not own vehicle,"veh_num4.isna() | (veh_num4 == '')",0,0,0,coef_unavail,0
77
#,BEV Range,,,,
8-
util_dstgtrng1,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_1) & (df.fuel_type_1 == 'BEV'), 1, 0)",coef_dstgtrng,0,0,0,0
9-
util_dstgtrng2,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_2) & (df.fuel_type_2 == 'BEV'), 1, 0)",0,coef_dstgtrng,0,0,0
10-
util_dstgtrng3,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_3) & (df.fuel_type_3 == 'BEV'), 1, 0)",0,0,coef_dstgtrng,0,0
11-
util_dstgtrng4,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_4) & (df.fuel_type_4 == 'BEV'), 1, 0)",0,0,0,coef_dstgtrng,0
8+
util_dstgtrng1,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_1) & (df.fuel_type_1 == 1), 1, 0)",coef_dstgtrng,0,0,0,0
9+
util_dstgtrng2,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_2) & (df.fuel_type_2 == 1), 1, 0)",0,coef_dstgtrng,0,0,0
10+
util_dstgtrng3,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_3) & (df.fuel_type_3 == 1), 1, 0)",0,0,coef_dstgtrng,0,0
11+
util_dstgtrng4,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_4) & (df.fuel_type_4 == 1), 1, 0)",0,0,0,coef_dstgtrng,0
1212
#,Vehicles & Driver interactions,,,,
1313
util_vehltdr_nh,Vehicles < Drivers -- Non-Household Vehicle,"hh_veh_lt_drivers",0,0,0,0,coef_vehltdr_nh
1414
util_vehltdr_nh,Vehicles > Drivers -- Non-Household Vehicle,"hh_veh_gt_drivers",0,0,0,0,coef_vehgtdr_nh
15-
util_vehltdr_van1,Vehicles > Drivers -- Van alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Van')",coef_vehltdr_van,0,0,0,0
16-
util_vehltdr_van2,Vehicles > Drivers -- Van alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Van')",0,coef_vehltdr_van,0,0,0
17-
util_vehltdr_van3,Vehicles > Drivers -- Van alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Van')",0,0,coef_vehltdr_van,0,0
18-
util_vehltdr_van4,Vehicles > Drivers -- Van alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Van')",0,0,0,coef_vehltdr_van,0
19-
util_vehltdr_suv1,Vehicles > Drivers -- SUV alt 1,"hh_veh_gt_drivers * (body_type_1 == 'SUV')",coef_vehltdr_suv,0,0,0,0
20-
util_vehltdr_suv2,Vehicles > Drivers -- SUV alt 2,"hh_veh_gt_drivers * (body_type_2 == 'SUV')",0,coef_vehltdr_suv,0,0,0
21-
util_vehltdr_suv3,Vehicles > Drivers -- SUV alt 3,"hh_veh_gt_drivers * (body_type_3 == 'SUV')",0,0,coef_vehltdr_suv,0,0
22-
util_vehltdr_suv4,Vehicles > Drivers -- SUV alt 4,"hh_veh_gt_drivers * (body_type_4 == 'SUV')",0,0,0,coef_vehltdr_suv,0
23-
util_vehltdr_pu1,Vehicles > Drivers -- Pickup alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Pickup')",coef_vehltdr_pu,0,0,0,0
24-
util_vehltdr_pu2,Vehicles > Drivers -- Pickup alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Pickup')",0,coef_vehltdr_pu,0,0,0
25-
util_vehltdr_pu3,Vehicles > Drivers -- Pickup alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Pickup')",0,0,coef_vehltdr_pu,0,0
26-
util_vehltdr_pu4,Vehicles > Drivers -- Pickup alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Pickup')",0,0,0,coef_vehltdr_pu,0
27-
util_vehltdr_mc1,Vehicles > Drivers -- Motorcycle alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Motorcycle')",coef_vehltdr_mc,0,0,0,0
28-
util_vehltdr_mc2,Vehicles > Drivers -- Motorcycle alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Motorcycle')",0,coef_vehltdr_mc,0,0,0
29-
util_vehltdr_mc3,Vehicles > Drivers -- Motorcycle alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Motorcycle')",0,0,coef_vehltdr_mc,0,0
30-
util_vehltdr_mc4,Vehicles > Drivers -- Motorcycle alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Motorcycle')",0,0,0,coef_vehltdr_mc,0
31-
util_vehltdr_hyb1,Vehicles > Drivers -- Hybrid alt 1,"hh_veh_gt_drivers * (fuel_type_1 == 'Hybrid')",coef_vehltdr_hyb,0,0,0,0
32-
util_vehltdr_hyb2,Vehicles > Drivers -- Hybrid alt 2,"hh_veh_gt_drivers * (fuel_type_2 == 'Hybrid')",0,coef_vehltdr_hyb,0,0,0
33-
util_vehltdr_hyb3,Vehicles > Drivers -- Hybrid alt 3,"hh_veh_gt_drivers * (fuel_type_3 == 'Hybrid')",0,0,coef_vehltdr_hyb,0,0
34-
util_vehltdr_hyb4,Vehicles > Drivers -- Hybrid alt 4,"hh_veh_gt_drivers * (fuel_type_4 == 'Hybrid')",0,0,0,coef_vehltdr_hyb,0
35-
util_vehltdr_ev1,Vehicles > Drivers -- Hybrid alt 1,"hh_veh_gt_drivers * ((fuel_type_1=='PEV') | (fuel_type_1=='BEV'))",coef_vehltdr_ev,0,0,0,0
36-
util_vehltdr_ev2,Vehicles > Drivers -- Hybrid alt 2,"hh_veh_gt_drivers * ((fuel_type_2=='PEV') | (fuel_type_2=='BEV'))",0,coef_vehltdr_ev,0,0,0
37-
util_vehltdr_ev3,Vehicles > Drivers -- Hybrid alt 3,"hh_veh_gt_drivers * ((fuel_type_3=='PEV') | (fuel_type_3=='BEV'))",0,0,coef_vehltdr_ev,0,0
38-
util_vehltdr_ev4,Vehicles > Drivers -- Hybrid alt 4,"hh_veh_gt_drivers * ((fuel_type_4=='PEV') | (fuel_type_4=='BEV'))",0,0,0,coef_vehltdr_ev,0
15+
util_vehltdr_van1,Vehicles > Drivers -- Van alt 1,"hh_veh_gt_drivers * (body_type_1 == 5)",coef_vehltdr_van,0,0,0,0
16+
util_vehltdr_van2,Vehicles > Drivers -- Van alt 2,"hh_veh_gt_drivers * (body_type_2 == 5)",0,coef_vehltdr_van,0,0,0
17+
util_vehltdr_van3,Vehicles > Drivers -- Van alt 3,"hh_veh_gt_drivers * (body_type_3 == 5)",0,0,coef_vehltdr_van,0,0
18+
util_vehltdr_van4,Vehicles > Drivers -- Van alt 4,"hh_veh_gt_drivers * (body_type_4 == 5)",0,0,0,coef_vehltdr_van,0
19+
util_vehltdr_suv1,Vehicles > Drivers -- SUV alt 1,"hh_veh_gt_drivers * (body_type_1 == 4)",coef_vehltdr_suv,0,0,0,0
20+
util_vehltdr_suv2,Vehicles > Drivers -- SUV alt 2,"hh_veh_gt_drivers * (body_type_2 == 4)",0,coef_vehltdr_suv,0,0,0
21+
util_vehltdr_suv3,Vehicles > Drivers -- SUV alt 3,"hh_veh_gt_drivers * (body_type_3 == 4)",0,0,coef_vehltdr_suv,0,0
22+
util_vehltdr_suv4,Vehicles > Drivers -- SUV alt 4,"hh_veh_gt_drivers * (body_type_4 == 4)",0,0,0,coef_vehltdr_suv,0
23+
util_vehltdr_pu1,Vehicles > Drivers -- Pickup alt 1,"hh_veh_gt_drivers * (body_type_1 == 3)",coef_vehltdr_pu,0,0,0,0
24+
util_vehltdr_pu2,Vehicles > Drivers -- Pickup alt 2,"hh_veh_gt_drivers * (body_type_2 == 3)",0,coef_vehltdr_pu,0,0,0
25+
util_vehltdr_pu3,Vehicles > Drivers -- Pickup alt 3,"hh_veh_gt_drivers * (body_type_3 == 3)",0,0,coef_vehltdr_pu,0,0
26+
util_vehltdr_pu4,Vehicles > Drivers -- Pickup alt 4,"hh_veh_gt_drivers * (body_type_4 == 3)",0,0,0,coef_vehltdr_pu,0
27+
util_vehltdr_mc1,Vehicles > Drivers -- Motorcycle alt 1,"hh_veh_gt_drivers * (body_type_1 == 2)",coef_vehltdr_mc,0,0,0,0
28+
util_vehltdr_mc2,Vehicles > Drivers -- Motorcycle alt 2,"hh_veh_gt_drivers * (body_type_2 == 2)",0,coef_vehltdr_mc,0,0,0
29+
util_vehltdr_mc3,Vehicles > Drivers -- Motorcycle alt 3,"hh_veh_gt_drivers * (body_type_3 == 2)",0,0,coef_vehltdr_mc,0,0
30+
util_vehltdr_mc4,Vehicles > Drivers -- Motorcycle alt 4,"hh_veh_gt_drivers * (body_type_4 == 2)",0,0,0,coef_vehltdr_mc,0
31+
util_vehltdr_hyb1,Vehicles > Drivers -- Hybrid alt 1,"hh_veh_gt_drivers * (fuel_type_1 == 4)",coef_vehltdr_hyb,0,0,0,0
32+
util_vehltdr_hyb2,Vehicles > Drivers -- Hybrid alt 2,"hh_veh_gt_drivers * (fuel_type_2 == 4)",0,coef_vehltdr_hyb,0,0,0
33+
util_vehltdr_hyb3,Vehicles > Drivers -- Hybrid alt 3,"hh_veh_gt_drivers * (fuel_type_3 == 4)",0,0,coef_vehltdr_hyb,0,0
34+
util_vehltdr_hyb4,Vehicles > Drivers -- Hybrid alt 4,"hh_veh_gt_drivers * (fuel_type_4 == 4)",0,0,0,coef_vehltdr_hyb,0
35+
util_vehltdr_ev1,Vehicles > Drivers -- EV alt 1,"hh_veh_gt_drivers * ((fuel_type_1==5) | (fuel_type_1==1))",coef_vehltdr_ev,0,0,0,0
36+
util_vehltdr_ev2,Vehicles > Drivers -- EV alt 2,"hh_veh_gt_drivers * ((fuel_type_2==5) | (fuel_type_2==1))",0,coef_vehltdr_ev,0,0,0
37+
util_vehltdr_ev3,Vehicles > Drivers -- EV alt 3,"hh_veh_gt_drivers * ((fuel_type_3==5) | (fuel_type_3==1))",0,0,coef_vehltdr_ev,0,0
38+
util_vehltdr_ev4,Vehicles > Drivers -- EV alt 4,"hh_veh_gt_drivers * ((fuel_type_4==5) | (fuel_type_4==1))",0,0,0,coef_vehltdr_ev,0
3939
util_vehltdr_age1,Vehicles > Drivers -- Age alt 1,"hh_veh_gt_drivers * age_1",coef_vehltdr_age,0,0,0,0
4040
util_vehltdr_age2,Vehicles > Drivers -- Age alt 2,"hh_veh_gt_drivers * age_2",0,coef_vehltdr_age,0,0,0
4141
util_vehltdr_age3,Vehicles > Drivers -- Age alt 3,"hh_veh_gt_drivers * age_3",0,0,coef_vehltdr_age,0,0
4242
util_vehltdr_age4,Vehicles > Drivers -- Age alt 4,"hh_veh_gt_drivers * age_4",0,0,0,coef_vehltdr_age,0
4343
#,Occupancy interactions,,,,
44-
util_maxocc_van1,Maximum Occupancy -- Van alt 1,"@occup * (df.body_type_1 == 'Van')",coef_maxocc_van,0,0,0,0
45-
util_maxocc_van2,Maximum Occupancy -- Van alt 2,"@occup * (df.body_type_2 == 'Van')",0,coef_maxocc_van,0,0,0
46-
util_maxocc_van3,Maximum Occupancy -- Van alt 3,"@occup * (df.body_type_3 == 'Van')",0,0,coef_maxocc_van,0,0
47-
util_maxocc_van4,Maximum Occupancy -- Van alt 4,"@occup * (df.body_type_4 == 'Van')",0,0,0,coef_maxocc_van,0
48-
util_maxocc_suv1,Maximum Occupancy -- SUV alt 1,"@occup * (df.body_type_1 == 'SUV')",coef_maxocc_suv,0,0,0,0
49-
util_maxocc_suv2,Maximum Occupancy -- SUV alt 2,"@occup * (df.body_type_2 == 'SUV')",0,coef_maxocc_suv,0,0,0
50-
util_maxocc_suv3,Maximum Occupancy -- SUV alt 3,"@occup * (df.body_type_3 == 'SUV')",0,0,coef_maxocc_suv,0,0
51-
util_maxocc_suv4,Maximum Occupancy -- SUV alt 4,"@occup * (df.body_type_4 == 'SUV')",0,0,0,coef_maxocc_suv,0
52-
util_maxocc_pu1,Maximum Occupancy -- Pickup alt 1,"@occup * (df.body_type_1 == 'Pickup')",coef_maxocc_pu,0,0,0,0
53-
util_maxocc_pu2,Maximum Occupancy -- Pickup alt 2,"@occup * (df.body_type_2 == 'Pickup')",0,coef_maxocc_pu,0,0,0
54-
util_maxocc_pu3,Maximum Occupancy -- Pickup alt 3,"@occup * (df.body_type_3 == 'Pickup')",0,0,coef_maxocc_pu,0,0
55-
util_maxocc_pu4,Maximum Occupancy -- Pickup alt 4,"@occup * (df.body_type_4 == 'Pickup')",0,0,0,coef_maxocc_pu,0
56-
util_maxocc_mc1,Maximum Occupancy -- Motorcycle alt 1,"@occup * (df.body_type_1 == 'Motorcycle')",coef_maxocc_mc,0,0,0,0
57-
util_maxocc_mc2,Maximum Occupancy -- Motorcycle alt 2,"@occup * (df.body_type_2 == 'Motorcycle')",0,coef_maxocc_mc,0,0,0
58-
util_maxocc_mc3,Maximum Occupancy -- Motorcycle alt 3,"@occup * (df.body_type_3 == 'Motorcycle')",0,0,coef_maxocc_mc,0,0
59-
util_maxocc_mc4,Maximum Occupancy -- Motorcycle alt 4,"@occup * (df.body_type_4 == 'Motorcycle')",0,0,0,coef_maxocc_mc,0
44+
util_maxocc_van1,Maximum Occupancy -- Van alt 1,"@occup * (df.body_type_1 == 5)",coef_maxocc_van,0,0,0,0
45+
util_maxocc_van2,Maximum Occupancy -- Van alt 2,"@occup * (df.body_type_2 == 5)",0,coef_maxocc_van,0,0,0
46+
util_maxocc_van3,Maximum Occupancy -- Van alt 3,"@occup * (df.body_type_3 == 5)",0,0,coef_maxocc_van,0,0
47+
util_maxocc_van4,Maximum Occupancy -- Van alt 4,"@occup * (df.body_type_4 == 5)",0,0,0,coef_maxocc_van,0
48+
util_maxocc_suv1,Maximum Occupancy -- SUV alt 1,"@occup * (df.body_type_1 == 4)",coef_maxocc_suv,0,0,0,0
49+
util_maxocc_suv2,Maximum Occupancy -- SUV alt 2,"@occup * (df.body_type_2 == 4)",0,coef_maxocc_suv,0,0,0
50+
util_maxocc_suv3,Maximum Occupancy -- SUV alt 3,"@occup * (df.body_type_3 == 4)",0,0,coef_maxocc_suv,0,0
51+
util_maxocc_suv4,Maximum Occupancy -- SUV alt 4,"@occup * (df.body_type_4 == 4)",0,0,0,coef_maxocc_suv,0
52+
util_maxocc_pu1,Maximum Occupancy -- Pickup alt 1,"@occup * (df.body_type_1 == 3)",coef_maxocc_pu,0,0,0,0
53+
util_maxocc_pu2,Maximum Occupancy -- Pickup alt 2,"@occup * (df.body_type_2 == 3)",0,coef_maxocc_pu,0,0,0
54+
util_maxocc_pu3,Maximum Occupancy -- Pickup alt 3,"@occup * (df.body_type_3 == 3)",0,0,coef_maxocc_pu,0,0
55+
util_maxocc_pu4,Maximum Occupancy -- Pickup alt 4,"@occup * (df.body_type_4 == 3)",0,0,0,coef_maxocc_pu,0
56+
util_maxocc_mc1,Maximum Occupancy -- Motorcycle alt 1,"@occup * (df.body_type_1 == 2)",coef_maxocc_mc,0,0,0,0
57+
util_maxocc_mc2,Maximum Occupancy -- Motorcycle alt 2,"@occup * (df.body_type_2 == 2)",0,coef_maxocc_mc,0,0,0
58+
util_maxocc_mc3,Maximum Occupancy -- Motorcycle alt 3,"@occup * (df.body_type_3 == 2)",0,0,coef_maxocc_mc,0,0
59+
util_maxocc_mc4,Maximum Occupancy -- Motorcycle alt 4,"@occup * (df.body_type_4 == 2)",0,0,0,coef_maxocc_mc,0
6060
util_maxocc_age1,Maximum Occupancy -- Age alt 1,"@occup * df.age_1",coef_maxocc_age,0,0,0,0
6161
util_maxocc_age2,Maximum Occupancy -- Age alt 2,"@occup * df.age_2",0,coef_maxocc_age,0,0,0
6262
util_maxocc_age3,Maximum Occupancy -- Age alt 3,"@occup * df.age_3",0,0,coef_maxocc_age,0,0
6363
util_maxocc_age4,Maximum Occupancy -- Age alt 4,"@occup * df.age_4",0,0,0,coef_maxocc_age,0
6464
util_maxocc_nh,Maximum Occupancy -- Age alt 1,"@occup",0,0,0,0,util_maxocc_nh
6565
#,Alternative Specific Constants,,,,
6666
util_non_hh,Non-Household Vehicle Constant,"1",0,0,0,0,coef_non_hh
67-
util_van1,Van ASC alt 1,"(body_type_1 == 'Van')",coef_van,0,0,0,0
68-
util_van2,Van ASC alt 2,"(body_type_2 == 'Van')",0,coef_van,0,0,0
69-
util_van3,Van ASC alt 3,"(body_type_3 == 'Van')",0,0,coef_van,0,0
70-
util_van4,Van ASC alt 4,"(body_type_4 == 'Van')",0,0,0,coef_van,0
71-
util_suv1,SUV ASC alt 1,"(body_type_1 == 'SUV')",coef_suv,0,0,0,0
72-
util_suv2,SUV ASC alt 2,"(body_type_2 == 'SUV')",0,coef_suv,0,0,0
73-
util_suv3,SUV ASC alt 3,"(body_type_3 == 'SUV')",0,0,coef_suv,0,0
74-
util_suv4,SUV ASC alt 4,"(body_type_4 == 'SUV')",0,0,0,coef_suv,0
75-
util_pu1,Pickup ASC alt 1,"(body_type_1 == 'Pickup')",coef_pu,0,0,0,0
76-
util_pu2,Pickup ASC alt 2,"(body_type_2 == 'Pickup')",0,coef_pu,0,0,0
77-
util_pu3,Pickup ASC alt 3,"(body_type_3 == 'Pickup')",0,0,coef_pu,0,0
78-
util_pu4,Pickup ASC alt 4,"(body_type_4 == 'Pickup')",0,0,0,coef_pu,0
79-
util_mc1,Motorcycle ASC alt 1,"(body_type_1 == 'Motorcycle')",coef_mc,0,0,0,0
80-
util_mc2,Motorcycle ASC alt 2,"(body_type_2 == 'Motorcycle')",0,coef_mc,0,0,0
81-
util_mc3,Motorcycle ASC alt 3,"(body_type_3 == 'Motorcycle')",0,0,coef_mc,0,0
82-
util_mc4,Motorcycle ASC alt 4,"(body_type_4 == 'Motorcycle')",0,0,0,coef_mc,0
83-
util_dsl1,Diesel ASC alt 1,"(fuel_type_1 == 'Diesel')",coef_dsl,0,0,0,0
84-
util_dsl2,Diesel ASC alt 2,"(fuel_type_2 == 'Diesel')",0,coef_dsl,0,0,0
85-
util_dsl3,Diesel ASC alt 3,"(fuel_type_3 == 'Diesel')",0,0,coef_dsl,0,0
86-
util_dsl4,Diesel ASC alt 4,"(fuel_type_4 == 'Diesel')",0,0,0,coef_dsl,0
87-
util_hyb1,Hybrid ASC alt 1,"(fuel_type_1 == 'Hybrid')",coef_hyb,0,0,0,0
88-
util_hyb2,Hybrid ASC alt 2,"(fuel_type_2 == 'Hybrid')",0,coef_hyb,0,0,0
89-
util_hyb3,Hybrid ASC alt 3,"(fuel_type_3 == 'Hybrid')",0,0,coef_hyb,0,0
90-
util_hyb4,Hybrid ASC alt 4,"(fuel_type_4 == 'Hybrid')",0,0,0,coef_hyb,0
91-
util_pev1,PEV ASC alt 1,"(fuel_type_1 == 'PEV')",coef_pev,0,0,0,0
92-
util_pev2,PEV ASC alt 2,"(fuel_type_2 == 'PEV')",0,coef_pev,0,0,0
93-
util_pev3,PEV ASC alt 3,"(fuel_type_3 == 'PEV')",0,0,coef_pev,0,0
94-
util_pev4,PEV ASC alt 4,"(fuel_type_4 == 'PEV')",0,0,0,coef_pev,0
95-
util_bev1,BEV ASC alt 1,"(fuel_type_1 == 'BEV')",coef_bev,0,0,0,0
96-
util_bev2,BEV ASC alt 2,"(fuel_type_2 == 'BEV')",0,coef_bev,0,0,0
97-
util_bev3,BEV ASC alt 3,"(fuel_type_3 == 'BEV')",0,0,coef_bev,0,0
98-
util_bev4,BEV ASC alt 4,"(fuel_type_4 == 'BEV')",0,0,0,coef_bev,0
67+
util_van1,Van ASC alt 1,"(body_type_1 == 5)",coef_van,0,0,0,0
68+
util_van2,Van ASC alt 2,"(body_type_2 == 5)",0,coef_van,0,0,0
69+
util_van3,Van ASC alt 3,"(body_type_3 == 5)",0,0,coef_van,0,0
70+
util_van4,Van ASC alt 4,"(body_type_4 == 5)",0,0,0,coef_van,0
71+
util_suv1,SUV ASC alt 1,"(body_type_1 == 4)",coef_suv,0,0,0,0
72+
util_suv2,SUV ASC alt 2,"(body_type_2 == 4)",0,coef_suv,0,0,0
73+
util_suv3,SUV ASC alt 3,"(body_type_3 == 4)",0,0,coef_suv,0,0
74+
util_suv4,SUV ASC alt 4,"(body_type_4 == 4)",0,0,0,coef_suv,0
75+
util_pu1,Pickup ASC alt 1,"(body_type_1 == 3)",coef_pu,0,0,0,0
76+
util_pu2,Pickup ASC alt 2,"(body_type_2 == 3)",0,coef_pu,0,0,0
77+
util_pu3,Pickup ASC alt 3,"(body_type_3 == 3)",0,0,coef_pu,0,0
78+
util_pu4,Pickup ASC alt 4,"(body_type_4 == 3)",0,0,0,coef_pu,0
79+
util_mc1,Motorcycle ASC alt 1,"(body_type_1 == 2)",coef_mc,0,0,0,0
80+
util_mc2,Motorcycle ASC alt 2,"(body_type_2 == 2)",0,coef_mc,0,0,0
81+
util_mc3,Motorcycle ASC alt 3,"(body_type_3 == 2)",0,0,coef_mc,0,0
82+
util_mc4,Motorcycle ASC alt 4,"(body_type_4 == 2)",0,0,0,coef_mc,0
83+
util_dsl1,Diesel ASC alt 1,"(fuel_type_1 == 2)",coef_dsl,0,0,0,0
84+
util_dsl2,Diesel ASC alt 2,"(fuel_type_2 == 2)",0,coef_dsl,0,0,0
85+
util_dsl3,Diesel ASC alt 3,"(fuel_type_3 == 2)",0,0,coef_dsl,0,0
86+
util_dsl4,Diesel ASC alt 4,"(fuel_type_4 == 2)",0,0,0,coef_dsl,0
87+
util_hyb1,Hybrid ASC alt 1,"(fuel_type_1 == 4)",coef_hyb,0,0,0,0
88+
util_hyb2,Hybrid ASC alt 2,"(fuel_type_2 == 4)",0,coef_hyb,0,0,0
89+
util_hyb3,Hybrid ASC alt 3,"(fuel_type_3 == 4)",0,0,coef_hyb,0,0
90+
util_hyb4,Hybrid ASC alt 4,"(fuel_type_4 == 4)",0,0,0,coef_hyb,0
91+
util_pev1,PEV ASC alt 1,"(fuel_type_1 == 5)",coef_pev,0,0,0,0
92+
util_pev2,PEV ASC alt 2,"(fuel_type_2 == 5)",0,coef_pev,0,0,0
93+
util_pev3,PEV ASC alt 3,"(fuel_type_3 == 5)",0,0,coef_pev,0,0
94+
util_pev4,PEV ASC alt 4,"(fuel_type_4 == 5)",0,0,0,coef_pev,0
95+
util_bev1,BEV ASC alt 1,"(fuel_type_1 == 1)",coef_bev,0,0,0,0
96+
util_bev2,BEV ASC alt 2,"(fuel_type_2 == 1)",0,coef_bev,0,0,0
97+
util_bev3,BEV ASC alt 3,"(fuel_type_3 == 1)",0,0,coef_bev,0,0
98+
util_bev4,BEV ASC alt 4,"(fuel_type_4 == 1)",0,0,0,coef_bev,0
9999
util_age2_1,Age 1 alt 1,"(age_1 == 2)",coef_age2,0,0,0,0
100100
util_age2_2,Age 1 alt 2,"(age_2 == 2)",0,coef_age2,0,0,0
101101
util_age2_3,Age 1 alt 3,"(age_3 == 2)",0,0,coef_age2,0,0

ext-configs/vehicle_allocation_annotate_choosers_preprocessor.csv

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@ Age of vehicle alternative 1,age_1,"df.veh_num1.astype(str).str.split('_').str[1
66
Age of vehicle alternative 2,age_2,"df.veh_num2.astype(str).str.split('_').str[1].fillna(0).astype(int)"
77
Age of vehicle alternative 3,age_3,"df.veh_num3.astype(str).str.split('_').str[1].fillna(0).astype(int)"
88
Age of vehicle alternative 4,age_4,"df.veh_num4.astype(str).str.split('_').str[1].fillna(0).astype(int)"
9-
body type of vehicle alternative 1,body_type_1,"df.veh_num1.astype(str).str.split('_').str[0]"
10-
body type of vehicle alternative 2,body_type_2,"df.veh_num2.astype(str).str.split('_').str[0]"
11-
body type of vehicle alternative 3,body_type_3,"df.veh_num3.astype(str).str.split('_').str[0]"
12-
body type of vehicle alternative 4,body_type_4,"df.veh_num4.astype(str).str.split('_').str[0]"
13-
fuel type of vehicle alternative 1,fuel_type_1,"df.veh_num1.astype(str).str.split('_').str[2]"
14-
fuel type of vehicle alternative 2,fuel_type_2,"df.veh_num2.astype(str).str.split('_').str[2]"
15-
fuel type of vehicle alternative 3,fuel_type_3,"df.veh_num3.astype(str).str.split('_').str[2]"
16-
fuel type of vehicle alternative 4,fuel_type_4,"df.veh_num4.astype(str).str.split('_').str[2]"
9+
body type of vehicle alternative 1,_str_body_type_1,"df.veh_num1.astype(str).str.split('_').str[0]"
10+
body type of vehicle alternative 2,_str_body_type_2,"df.veh_num2.astype(str).str.split('_').str[0]"
11+
body type of vehicle alternative 3,_str_body_type_3,"df.veh_num3.astype(str).str.split('_').str[0]"
12+
body type of vehicle alternative 4,_str_body_type_4,"df.veh_num4.astype(str).str.split('_').str[0]"
13+
integer encoded body type 1,body_type_1,"_str_body_type_1.map({'Car': 1, 'Motorcycle': 2, 'Pickup': 3, 'SUV': 4, 'Van': 5}).fillna(-1).astype(int)"
14+
integer encoded body type 2,body_type_2,"_str_body_type_2.map({'Car': 1, 'Motorcycle': 2, 'Pickup': 3, 'SUV': 4, 'Van': 5}).fillna(-1).astype(int)"
15+
integer encoded body type 3,body_type_3,"_str_body_type_3.map({'Car': 1, 'Motorcycle': 2, 'Pickup': 3, 'SUV': 4, 'Van': 5}).fillna(-1).astype(int)"
16+
integer encoded body type 4,body_type_4,"_str_body_type_4.map({'Car': 1, 'Motorcycle': 2, 'Pickup': 3, 'SUV': 4, 'Van': 5}).fillna(-1).astype(int)"
17+
fuel type of vehicle alternative 1,_str_fuel_type_1,"df.veh_num1.astype(str).str.split('_').str[2]"
18+
fuel type of vehicle alternative 2,_str_fuel_type_2,"df.veh_num2.astype(str).str.split('_').str[2]"
19+
fuel type of vehicle alternative 3,_str_fuel_type_3,"df.veh_num3.astype(str).str.split('_').str[2]"
20+
fuel type of vehicle alternative 4,_str_fuel_type_4,"df.veh_num4.astype(str).str.split('_').str[2]"
21+
integer encoded fuel type 1,fuel_type_1,"_str_fuel_type_1.map({'BEV': 1, 'Diesel': 2, 'Gas': 3, 'Hybrid': 4, 'PEV': 5}).fillna(-1).astype(int)"
22+
integer encoded fuel type 2,fuel_type_2,"_str_fuel_type_2.map({'BEV': 1, 'Diesel': 2, 'Gas': 3, 'Hybrid': 4, 'PEV': 5}).fillna(-1).astype(int)"
23+
integer encoded fuel type 3,fuel_type_3,"_str_fuel_type_3.map({'BEV': 1, 'Diesel': 2, 'Gas': 3, 'Hybrid': 4, 'PEV': 5}).fillna(-1).astype(int)"
24+
integer encoded fuel type 4,fuel_type_4,"_str_fuel_type_4.map({'BEV': 1, 'Diesel': 2, 'Gas': 3, 'Hybrid': 4, 'PEV': 5}).fillna(-1).astype(int)"
1725
Range of vehicle alternative 1,Range_1,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num1)"
1826
Range of vehicle alternative 2,Range_2,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num2)"
1927
Range of vehicle alternative 3,Range_3,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num3)"

0 commit comments

Comments
 (0)