3535energy_weights = energy_weights ** (1 / 4 )
3636time_weights = 1 - energy_weights
3737
38+
3839def get_test_cases (energy_key : str ):
39- return [
40+ return [
4041 {
4142 "name" : f"energy_{ i } " ,
4243 "weights" : {
@@ -48,6 +49,7 @@ def get_test_cases(energy_key: str):
4849 for i in range (len (energy_weights ))
4950 ]
5051
52+
5153"""
5254Let's take a quick look at the weights we've generated.
5355"""
@@ -72,9 +74,9 @@ def get_test_cases(energy_key: str):
7274 "destination_y" : 39.7867693 ,
7375 "model_name" : "2017_CHEVROLET_Bolt" ,
7476 "vehicle_rates" : {
75- "trip_distance" : {"type" : "distance" , "factor" : 0.655 , "unit" : "miles" },
76- "trip_time" : {"type" : "time" , "factor" : 20.0 , "unit" : "hours" },
77- "trip_energy_electric" : {"type" : "energy" , "factor" : 0.12 , "unit" : "kwh" },
77+ "trip_distance" : {"type" : "distance" , "factor" : 0.655 , "unit" : "miles" },
78+ "trip_time" : {"type" : "time" , "factor" : 20.0 , "unit" : "hours" },
79+ "trip_energy_electric" : {"type" : "energy" , "factor" : 0.12 , "unit" : "kwh" },
7880 },
7981 "grid_search" : {
8082 "test_cases" : get_test_cases ("trip_energy_electric" ),
@@ -124,9 +126,9 @@ def get_test_cases(energy_key: str):
124126 "destination_y" : 39.7867693 ,
125127 "model_name" : "2016_TOYOTA_Camry_4cyl_2WD" ,
126128 "vehicle_rates" : {
127- "trip_distance" : {"type" : "distance" , "factor" : 0.655 , "unit" : "miles" },
128- "trip_time" : {"type" : "time" , "factor" : 20.0 , "unit" : "hours" },
129- "trip_energy_liquid" : {"type" : "energy" , "factor" : 3.0 , "unit" : "gge" },
129+ "trip_distance" : {"type" : "distance" , "factor" : 0.655 , "unit" : "miles" },
130+ "trip_time" : {"type" : "time" , "factor" : 20.0 , "unit" : "hours" },
131+ "trip_energy_liquid" : {"type" : "energy" , "factor" : 3.0 , "unit" : "gge" },
130132 },
131133 "grid_search" : {
132134 "test_cases" : get_test_cases ("trip_energy_liquid" ),
0 commit comments