Run Scenario module¶
t3co.run.run_scenario
¶
Module for loading vehicles, scenarios, running them and managing them
Config
dataclass
¶
This class reads T3COConfig.csv file containing analysis attributes like vehicle and scenario paths, TCO_method, and scenario attribute overrides.
Source code in t3co/run/run_scenario.py
Python | |
---|---|
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
TCO_method: str = 'DIRECT'
class-attribute
instance-attribute
¶
activate_mr_downtime_cost: bool = False
class-attribute
instance-attribute
¶
activate_tco_fueling_dwell_time_cost: bool = False
class-attribute
instance-attribute
¶
activate_tco_payload_cap_cost_multiplier: bool = False
class-attribute
instance-attribute
¶
aero_drag_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
aero_drag_imp_curves: str = ''
class-attribute
instance-attribute
¶
algorithms: str = ''
class-attribute
instance-attribute
¶
analysis_id: int = 0
class-attribute
instance-attribute
¶
analysis_name: str = ''
class-attribute
instance-attribute
¶
constraint_accel: bool = False
class-attribute
instance-attribute
¶
constraint_c_rate: bool = False
class-attribute
instance-attribute
¶
constraint_grade: bool = False
class-attribute
instance-attribute
¶
constraint_range: bool = False
class-attribute
instance-attribute
¶
constraint_trace_miss_dist_percent_on: bool = False
class-attribute
instance-attribute
¶
drive_cycle: str = None
class-attribute
instance-attribute
¶
dst_dir: str = ''
class-attribute
instance-attribute
¶
eng_eff_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
eng_eff_imp_curves: str = ''
class-attribute
instance-attribute
¶
ess_max_charging_power_kw: float = 0
class-attribute
instance-attribute
¶
fdt_frac_full_charge_bounds: list = field(default_factory=list)
class-attribute
instance-attribute
¶
fs_fueling_rate_diesel_gpm: float = 0
class-attribute
instance-attribute
¶
fs_fueling_rate_gasoline_gpm: float = 0
class-attribute
instance-attribute
¶
fs_fueling_rate_kg_per_min: float = 0
class-attribute
instance-attribute
¶
lw_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
lw_imp_curves: str = ''
class-attribute
instance-attribute
¶
objective_phev_minimize_fuel_use: bool = False
class-attribute
instance-attribute
¶
objective_tco: bool = False
class-attribute
instance-attribute
¶
resfile_suffix: str = None
class-attribute
instance-attribute
¶
scenario_file: str = ''
class-attribute
instance-attribute
¶
selections: str = ''
class-attribute
instance-attribute
¶
skip_all_opt: bool = True
class-attribute
instance-attribute
¶
vehicle_file: str = ''
class-attribute
instance-attribute
¶
vehicle_life_yr: float = 0
class-attribute
instance-attribute
¶
write_tsv: bool = False
class-attribute
instance-attribute
¶
__init__(analysis_id: int = 0, analysis_name: str = '', vehicle_file: str = '', scenario_file: str = '', dst_dir: str = '', resfile_suffix: str = None, write_tsv: bool = False, selections: str = '', vehicle_life_yr: float = 0, drive_cycle: str = None, ess_max_charging_power_kw: float = 0, fs_fueling_rate_kg_per_min: float = 0, fs_fueling_rate_gasoline_gpm: float = 0, fs_fueling_rate_diesel_gpm: float = 0, TCO_method: str = 'DIRECT', algorithms: str = '', lw_imp_curves: str = '', eng_eff_imp_curves: str = '', aero_drag_imp_curves: str = '', lw_imp_curve_sel: str = '', eng_eff_imp_curve_sel: str = '', aero_drag_imp_curve_sel: str = '', skip_all_opt: bool = True, constraint_range: bool = False, constraint_accel: bool = False, constraint_grade: bool = False, objective_tco: bool = False, constraint_c_rate: bool = False, constraint_trace_miss_dist_percent_on: bool = False, objective_phev_minimize_fuel_use: bool = False, activate_tco_payload_cap_cost_multiplier: bool = False, activate_tco_fueling_dwell_time_cost: bool = False, fdt_frac_full_charge_bounds: list = list(), activate_mr_downtime_cost: bool = False) -> None
¶
check_drivecycles_and_create_selections(config_file: str | Path)
¶
This method checks if the config.drive_cycle input is a file or a folder. If a folder is provided, then it creates a list of all selections for each drivecycle in the folders as config.dc_files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_file
|
str | Path
|
File path of config file |
required |
Source code in t3co/run/run_scenario.py
from_dict(config_dict: dict) -> Self
¶
This method generates a Config instance from config_dict
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_dict
|
dict
|
dictionary containing fields from T3CO Config input CSV file |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
Config instance containining all values from T3CO Config CSV file |
Source code in t3co/run/run_scenario.py
from_file(filename: str, analysis_id: int) -> Self
¶
This method generates a Config dictionary from CSV file and calls Config.from_dict
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
path of input T3CO Config file |
required |
analysis_id
|
int
|
analysis ID selections |
required |
Returns:
Type | Description |
---|---|
Self
|
Self.from_dict: method that gets Config instance from config_dict |
Source code in t3co/run/run_scenario.py
validate_analysis_id(filename: str, analysis_id: int = 0) -> Self
¶
This method validates that correct analysis id is input
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
T3CO Config input CSV file path |
required |
Raises:
Type | Description |
---|---|
Exception
|
Error if analysis_id not found |
Source code in t3co/run/run_scenario.py
Scenario
dataclass
¶
Class object that contains all TCO parameters and performance target (range, grade, accel) information for a vehicle such that performance and TCO can be computed during optimization
Source code in t3co/run/run_scenario.py
Python | |
---|---|
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
activate_mr_downtime_cost: bool = False
class-attribute
instance-attribute
¶
activate_tco_fueling_dwell_time_cost: bool = False
class-attribute
instance-attribute
¶
activate_tco_payload_cap_cost_multiplier: bool = True
class-attribute
instance-attribute
¶
aero_drag_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
constant_trip_distance_mi: float = 0
class-attribute
instance-attribute
¶
constraint_accel: bool = False
class-attribute
instance-attribute
¶
constraint_c_rate: bool = False
class-attribute
instance-attribute
¶
constraint_grade: bool = False
class-attribute
instance-attribute
¶
constraint_phev_minimize_fuel_use_on: bool = False
class-attribute
instance-attribute
¶
constraint_phev_minimize_fuel_use_percent: float = 0
class-attribute
instance-attribute
¶
constraint_range: bool = False
class-attribute
instance-attribute
¶
constraint_trace_miss_dist_percent_on: bool = False
class-attribute
instance-attribute
¶
desired_ess_replacements: float = 0
class-attribute
instance-attribute
¶
discount_rate_pct_per_yr: float = 0
class-attribute
instance-attribute
¶
dlf_min_charge_time_hr: float = 0
class-attribute
instance-attribute
¶
downtime_oppy_cost_dol_per_hr: float = 0
class-attribute
instance-attribute
¶
drive_cycle: str = ''
class-attribute
instance-attribute
¶
eng_eff_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
ess_base_cost_dol: float = 0
class-attribute
instance-attribute
¶
ess_charge_rate_kW: float = 0
class-attribute
instance-attribute
¶
ess_cost_dol_per_kw: float = 0
class-attribute
instance-attribute
¶
ess_cost_dol_per_kwh: float = 0
class-attribute
instance-attribute
¶
ess_cost_reduction_dol_per_yr: float = 0
class-attribute
instance-attribute
¶
ess_init_soc_accel: float = -1.0
class-attribute
instance-attribute
¶
ess_init_soc_grade: float = -1.0
class-attribute
instance-attribute
¶
ess_max_charging_power_kw: float = 0
class-attribute
instance-attribute
¶
ess_salvage_value_dol: float = 0
class-attribute
instance-attribute
¶
estimated_lost_payload_kg: float = 0
class-attribute
instance-attribute
¶
fc_cng_ice_cost_dol_per_kw: float = 0
class-attribute
instance-attribute
¶
fc_fuelcell_cost_dol_per_kw: float = 0
class-attribute
instance-attribute
¶
fc_ice_base_cost_dol: float = 0
class-attribute
instance-attribute
¶
fc_ice_cost_dol_per_kw: float = 0
class-attribute
instance-attribute
¶
fdt_available_freetime_hr: float = 0
class-attribute
instance-attribute
¶
fdt_avg_overhead_hr_per_dwell_hr: float = 0
class-attribute
instance-attribute
¶
fdt_dwpt_fraction_power_pct: float = 0
class-attribute
instance-attribute
¶
fdt_frac_full_charge_bounds: float = 0
class-attribute
instance-attribute
¶
fdt_num_free_dwell_trips: float = 0
class-attribute
instance-attribute
¶
fs_cng_cost_dol_per_kwh: float = 0
class-attribute
instance-attribute
¶
fs_cost_dol_per_kwh: float = 0
class-attribute
instance-attribute
¶
fs_fueling_rate_diesel_gpm: float = 0
class-attribute
instance-attribute
¶
fs_fueling_rate_gasoline_gpm: float = 0
class-attribute
instance-attribute
¶
fs_fueling_rate_kg_per_min: float = 0
class-attribute
instance-attribute
¶
fs_h2_cost_dol_per_kwh: float = 0
class-attribute
instance-attribute
¶
fuel_type: list = field(default_factory=list)
class-attribute
instance-attribute
¶
gvwr_credit_kg: float = 0
class-attribute
instance-attribute
¶
gvwr_kg: float = 0
class-attribute
instance-attribute
¶
insurance_rates_pct_per_yr: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_max_ess_kwh: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_max_fc_kw: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_max_fs_kwh: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_max_motor_kw: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_min_ess_kwh: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_min_fc_kw: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_min_fs_kwh: list = field(default_factory=list)
class-attribute
instance-attribute
¶
knob_min_motor_kw: list = field(default_factory=list)
class-attribute
instance-attribute
¶
labor_rate_dol_per_hr: float = 0
class-attribute
instance-attribute
¶
lw_imp_curve_sel: str = ''
class-attribute
instance-attribute
¶
maint_oper_cost_dol_per_mi: list = field(default_factory=list)
class-attribute
instance-attribute
¶
markup_pct: float = 0
class-attribute
instance-attribute
¶
max_time_0_to_30mph_at_gvwr_s: float = 0
class-attribute
instance-attribute
¶
max_time_0_to_60mph_at_gvwr_s: float = 0
class-attribute
instance-attribute
¶
max_time_dilation: float = -1
class-attribute
instance-attribute
¶
min_speed_at_1p25pct_grade_in_5min_mph: float = 0
class-attribute
instance-attribute
¶
min_speed_at_6pct_grade_in_5min_mph: float = 0
class-attribute
instance-attribute
¶
min_time_dilation: float = -1
class-attribute
instance-attribute
¶
missed_trace_correction: bool = False
class-attribute
instance-attribute
¶
model_year: float = 0
class-attribute
instance-attribute
¶
motor_power_override_kw_fc_demand_on_pct: float = -1
class-attribute
instance-attribute
¶
mr_avg_tire_life_mi: float = 0
class-attribute
instance-attribute
¶
mr_planned_downtime_hr_per_yr: float = 0
class-attribute
instance-attribute
¶
mr_tire_replace_downtime_hr_per_event: float = 0
class-attribute
instance-attribute
¶
mr_unplanned_downtime_hr_per_mi: list = field(default_factory=list)
class-attribute
instance-attribute
¶
objective_phev_minimize_fuel_use: bool = False
class-attribute
instance-attribute
¶
objective_tco: bool = False
class-attribute
instance-attribute
¶
origfc_eff_map: list = field(default_factory=list)
class-attribute
instance-attribute
¶
originalGliderPrice: float = -1.0
class-attribute
instance-attribute
¶
originalIceDolPerKw: float = -1.0
class-attribute
instance-attribute
¶
originalcargo_kg: float = -1.0
class-attribute
instance-attribute
¶
originaldrag_coef: float = -1
class-attribute
instance-attribute
¶
originalglider_kg: float = -1.0
class-attribute
instance-attribute
¶
pe_mc_base_cost_dol: float = 0
class-attribute
instance-attribute
¶
pe_mc_cost_dol_per_kw: float = 0
class-attribute
instance-attribute
¶
phev_utility_factor_computed: float = -1
class-attribute
instance-attribute
¶
phev_utility_factor_override: float = -1
class-attribute
instance-attribute
¶
plf_ref_veh_empty_mass_kg: float = 0
class-attribute
instance-attribute
¶
plf_reference_vehicle_cargo_capacity_kg: float = 0
class-attribute
instance-attribute
¶
plf_scenario_vehicle_cargo_capacity_kg: float = 0
class-attribute
instance-attribute
¶
plf_scenario_vehicle_empty_kg: float = 0
class-attribute
instance-attribute
¶
plug_base_cost_dol: float = 0
class-attribute
instance-attribute
¶
region: str = ''
class-attribute
instance-attribute
¶
residual_rate_pct: float = 0
class-attribute
instance-attribute
¶
segment_name: str = ''
class-attribute
instance-attribute
¶
selection: float = 0
class-attribute
instance-attribute
¶
shifts_per_year: list = field(default_factory=list)
class-attribute
instance-attribute
¶
skip_opt: bool = False
class-attribute
instance-attribute
¶
soc_norm_init_for_accel_pct: float = -1
class-attribute
instance-attribute
¶
soc_norm_init_for_grade_pct: float = -1
class-attribute
instance-attribute
¶
target_range_mi: float = 0
class-attribute
instance-attribute
¶
tax_rate_pct: float = 0
class-attribute
instance-attribute
¶
time_dilation_tol: float = -1
class-attribute
instance-attribute
¶
trace_miss_dist_percent: float = 0
class-attribute
instance-attribute
¶
use_config: bool = True
class-attribute
instance-attribute
¶
vehicle_class: str = ''
class-attribute
instance-attribute
¶
vehicle_glider_cost_dol: float = 0
class-attribute
instance-attribute
¶
vehicle_life_yr: float = 0
class-attribute
instance-attribute
¶
vmt: list = field(default_factory=list)
class-attribute
instance-attribute
¶
vmt_reduct_per_yr: float = 0
class-attribute
instance-attribute
¶
vocation: str = ''
class-attribute
instance-attribute
¶
__init__(selection: float = 0, drive_cycle: str = '', use_config: bool = True, vmt_reduct_per_yr: float = 0, vmt: list = list(), constant_trip_distance_mi: float = 0, vehicle_life_yr: float = 0, desired_ess_replacements: float = 0, discount_rate_pct_per_yr: float = 0, ess_max_charging_power_kw: float = 0, ess_cost_dol_per_kw: float = 0, ess_cost_dol_per_kwh: float = 0, ess_base_cost_dol: float = 0, ess_cost_reduction_dol_per_yr: float = 0, ess_salvage_value_dol: float = 0, ess_charge_rate_kW: float = 0, pe_mc_cost_dol_per_kw: float = 0, pe_mc_base_cost_dol: float = 0, fc_ice_cost_dol_per_kw: float = 0, fc_ice_base_cost_dol: float = 0, fc_fuelcell_cost_dol_per_kw: float = 0, fs_cost_dol_per_kwh: float = 0, fs_h2_cost_dol_per_kwh: float = 0, plug_base_cost_dol: float = 0, markup_pct: float = 0, tax_rate_pct: float = 0, fc_cng_ice_cost_dol_per_kw: float = 0, fs_cng_cost_dol_per_kwh: float = 0, vehicle_glider_cost_dol: float = 0, segment_name: str = '', gvwr_kg: float = 0, gvwr_credit_kg: float = 0, fuel_type: list = list(), maint_oper_cost_dol_per_mi: list = list(), vocation: str = '', vehicle_class: str = '', model_year: float = 0, region: str = '', target_range_mi: float = 0, min_speed_at_6pct_grade_in_5min_mph: float = 0, min_speed_at_1p25pct_grade_in_5min_mph: float = 0, max_time_0_to_60mph_at_gvwr_s: float = 0, max_time_0_to_30mph_at_gvwr_s: float = 0, lw_imp_curve_sel: str = '', eng_eff_imp_curve_sel: str = '', aero_drag_imp_curve_sel: str = '', originalcargo_kg: float = -1.0, originalglider_kg: float = -1.0, originalGliderPrice: float = -1.0, originalIceDolPerKw: float = -1.0, origfc_eff_map: list = list(), originaldrag_coef: float = -1, ess_init_soc_grade: float = -1.0, ess_init_soc_accel: float = -1.0, soc_norm_init_for_accel_pct: float = -1, soc_norm_init_for_grade_pct: float = -1, fs_fueling_rate_gasoline_gpm: float = 0, fs_fueling_rate_diesel_gpm: float = 0, fs_fueling_rate_kg_per_min: float = 0, phev_utility_factor_override: float = -1, phev_utility_factor_computed: float = -1, motor_power_override_kw_fc_demand_on_pct: float = -1, shifts_per_year: list = list(), missed_trace_correction: bool = False, max_time_dilation: float = -1, min_time_dilation: float = -1, time_dilation_tol: float = -1, skip_opt: bool = False, knob_min_ess_kwh: list = list(), knob_max_ess_kwh: list = list(), knob_min_motor_kw: list = list(), knob_max_motor_kw: list = list(), knob_min_fc_kw: list = list(), knob_max_fc_kw: list = list(), knob_min_fs_kwh: list = list(), knob_max_fs_kwh: list = list(), objective_phev_minimize_fuel_use: bool = False, constraint_c_rate: bool = False, constraint_range: bool = False, constraint_accel: bool = False, constraint_grade: bool = False, objective_tco: bool = False, constraint_trace_miss_dist_percent_on: bool = False, trace_miss_dist_percent: float = 0, constraint_phev_minimize_fuel_use_on: bool = False, constraint_phev_minimize_fuel_use_percent: float = 0, labor_rate_dol_per_hr: float = 0, downtime_oppy_cost_dol_per_hr: float = 0, activate_tco_payload_cap_cost_multiplier: bool = True, plf_ref_veh_empty_mass_kg: float = 0, plf_scenario_vehicle_empty_kg: float = 0, plf_reference_vehicle_cargo_capacity_kg: float = 0, plf_scenario_vehicle_cargo_capacity_kg: float = 0, estimated_lost_payload_kg: float = 0, activate_tco_fueling_dwell_time_cost: bool = False, dlf_min_charge_time_hr: float = 0, fdt_dwpt_fraction_power_pct: float = 0, fdt_avg_overhead_hr_per_dwell_hr: float = 0, fdt_frac_full_charge_bounds: float = 0, fdt_num_free_dwell_trips: float = 0, fdt_available_freetime_hr: float = 0, insurance_rates_pct_per_yr: list = list(), residual_rate_pct: float = 0, activate_mr_downtime_cost: bool = False, mr_planned_downtime_hr_per_yr: float = 0, mr_unplanned_downtime_hr_per_mi: list = list(), mr_avg_tire_life_mi: float = 0, mr_tire_replace_downtime_hr_per_event: float = 0) -> None
¶
from_config(config: Config = None, verbose: bool = False) -> None
¶
This method overrides certain scenario fields if use_config is True and config object is not None
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
Config
|
Config object. Defaults to None. |
None
|
Source code in t3co/run/run_scenario.py
check_phev_init_socs(a_vehicle: vehicle.Vehicle, scenario: Scenario) -> None
¶
This function checks that soc_norm_init_for_grade_pct and soc_norm_init_for_accel_pct are present only for PHEVs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
scenario
|
Scenario
|
T3CO scenario object |
required |
Source code in t3co/run/run_scenario.py
create_fastsim_vehicle(veh_dict: dict = None) -> fastsim.vehicle.Vehicle
¶
This function creates and returns an empty FASTSim vehicle object with no attributes or
Parameters:
Name | Type | Description | Default |
---|---|---|---|
veh_dict
|
dict
|
Vehicle attributes dict. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
v |
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
Source code in t3co/run/run_scenario.py
get_objective_simdrive(analysis_vehicle: vehicle.Vehicle, cycle: fastsim.cycle.Cycle) -> fastsim.simdrive.SimDrive
¶
This function obtains the SimDrive for accel and grade test
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
cycle
|
fastsim.cycle.Cycle
|
FASTSim Cycle object |
required |
Returns:
Name | Type | Description |
---|---|---|
sd |
fastsim.simdrive.SimDrive
|
FASTSim SimDrive object containing vehicle inputs and simulation output attributes |
Source code in t3co/run/run_scenario.py
get_phev_util_factor(scenario: Scenario, v: fastsim.vehicle.Vehicle, mpgge: dict) -> float
¶
This function gets the PHEV utility factor derived from the computed range of the vehicle and the operational day range computed from shifts per year and the first vmt year
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenario
|
Scenario
|
T3CO scenario object |
required |
v
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
mpgge
|
dict
|
Miles per Gallon Gasoline Equivalent dictionary |
required |
Returns:
Name | Type | Description |
---|---|---|
uf |
float
|
PHEV computed utility factor |
Source code in t3co/run/run_scenario.py
get_scenario_and_cycle(veh_no: int, scenario_inputs_path: str, a_vehicle: fastsim.vehicle.Vehicle = None, config: Config = None, do_input_validation: bool = False) -> Tuple[Scenario, fastsim.cycle.Cycle]
¶
This function uses helper methods load_scenario and load_design_cycle_from_scenario to get scenario object and cycle object corresponding to selected vehicle (by veh_no)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
veh_no
|
int
|
vehicle selection number |
required |
scenario_inputs_path
|
str
|
input file path for scenario assumptions CSV |
required |
a_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object for given selection. Defaults to None. |
None
|
config
|
Config
|
Config object for current analysis. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
scenario |
Scenario
|
T3CO scenario object selected |
cyc |
fastsim.cycle.Cycle
|
FASTSim cycle object selected |
Source code in t3co/run/run_scenario.py
get_vehicle(veh_no: int, veh_input_path: str) -> fastsim.vehicle.Vehicle
¶
This function loads vehicle object from vehicle number and input csv filepath
Parameters:
Name | Type | Description | Default |
---|---|---|---|
veh_no
|
int
|
vehicle selection number |
required |
veh_input_path
|
str
|
vehicle model assumptions input CSV file path |
required |
Returns:
Name | Type | Description |
---|---|---|
veh |
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
Source code in t3co/run/run_scenario.py
limit_cargo_kg_for_moo_hev_bev(opt_scenario: Scenario, mooadvancedvehicle: fastsim.vehicle.Vehicle) -> None
¶
This helper method is used within T3COProblem to assign limited cargo capacity based on GVWR + GVWRCredit and optimization vehicle mass for advanced vehicles
Parameters:
Name | Type | Description | Default |
---|---|---|---|
opt_scenario
|
t3co.run_scenario.Scenario
|
T3CO scenario object |
required |
mooadvancedvehicle
|
fastsim.vehicle.Vehicle
|
pymoo optimization vehicle |
required |
Source code in t3co/run/run_scenario.py
load_design_cycle_from_path(cyc_file_path: str) -> fastsim.cycle.Cycle
¶
This helper method loads the Cycle object from the drivecycle filepath
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cyc_file_path
|
str
|
drivecycle input file path |
required |
Returns:
Name | Type | Description |
---|---|---|
range_cyc |
fastsim.cycle.Cycle
|
FASTSim cycle object for current Scenario object |
Source code in t3co/run/run_scenario.py
load_design_cycle_from_scenario(scenario: Scenario, config: Config = None, cyc_file_path: str = gl.OPTIMIZATION_DRIVE_CYCLES, do_input_validation: bool = False) -> fastsim.cycle.Cycle
¶
This helper method loads the design cycle used for mpgge and range determination. It can also be used standalone to get cycles not in standard gl.OPTIMIZATION_DRIVE_CYCLES location, but still needs cycle name from scenario object, carried in scenario.drive_cycle. If the drive cycles are a list of tuples, handle accordingly with eval.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenario
|
Scenario
|
Scenario object for current selection |
required |
cyc_file_path
|
str
|
drivecycle input file path. Defaults to gl.OPTIMIZATION_DRIVE_CYCLES. |
gl.OPTIMIZATION_DRIVE_CYCLES
|
Returns:
Name | Type | Description |
---|---|---|
range_cyc |
fastsim.cycle.Cycle
|
FASTSim cycle object for current Scenario object |
Source code in t3co/run/run_scenario.py
load_scenario(veh_no: int, scenario_inputs_path: str, a_vehicle: fastsim.vehicle.Vehicle = None, config: Config = None) -> Scenario
¶
This function gets the Scenario object from scenario input CSV filepath, initializes some fields, and overrides some fields based on Config object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
veh_no
|
int
|
vehicle selection number |
required |
scenario_inputs_path
|
str
|
input file path for scenario assumptions CSV |
required |
a_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object for given selection. Defaults to None. |
None
|
config
|
Config
|
Config object for current analysis. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
scenario |
Scenario
|
Scenario object for given selection |
Source code in t3co/run/run_scenario.py
Python | |
---|---|
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 |
|
rerun(vehicle: fastsim.vehicle.Vehicle, vocation: str, scenario: Scenario, config: Config)
¶
This function runs vehicle_scenario_sweep when given the vehicle and scenario objects
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
vocation
|
str
|
vocation description |
required |
scenario
|
Scenario
|
Scenario object |
required |
Returns:
Name | Type | Description |
---|---|---|
out |
dict
|
output dictionary containing TCO outputs |
Source code in t3co/run/run_scenario.py
reset_vehicle_weight(vehicle: fastsim.vehicle.Vehicle) -> None
¶
This function resets vehicle mass after loaded weight tests are done for accel and grade
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
Source code in t3co/run/run_scenario.py
Python | |
---|---|
run(veh_no: int, vocation: str = 'blank', vehicle_input_path: str = gl.FASTSIM_INPUTS, scenario_inputs_path: str = gl.OTHER_INPUTS)
¶
This function runs vehicle_scenario_sweep based on vehicle and scenario objects read from input file paths
Parameters:
Name | Type | Description | Default |
---|---|---|---|
veh_no
|
int
|
vehicle selection number |
required |
vocation
|
str
|
vocation description of selected vehicle. Defaults to "blank". |
'blank'
|
vehicle_input_path
|
str
|
input file path for vehicle assumptions CSV. Defaults to gl.FASTSIM_INPUTS. |
gl.FASTSIM_INPUTS
|
scenario_inputs_path
|
str
|
input file path for scenario assumptions CSV. Defaults to gl.OTHER_INPUTS. |
gl.OTHER_INPUTS
|
Returns:
Name | Type | Description |
---|---|---|
out |
dict
|
output dictionary containing TCO results |
Source code in t3co/run/run_scenario.py
run_grade_or_accel(test: str, analysis_vehicle: fastsim.vehicle.Vehicle, sim_drive: fastsim.simdrive.SimDrive, ess_init_soc: float) -> None
¶
This function handles initial SOC considerations for grade and accel tests
If ess_init_soc override is passed, use that Else if the vehicle is an HEV, use the standard HEV init SOC values for accel and grade Else, let FASTSim determine init SOC in sim_drive() BEVs use max_soc PHEVs use max_soc Conv init_soc doesn't matter HEVs attempt SOC balancing but that is overrident by HEV test init SOC
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test
|
str
|
'accel' or 'grade' test |
required |
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
sim_drive
|
fastsim.simdrive.SimDrive
|
FASTSim SimDrive object |
required |
ess_init_soc
|
float
|
ESS initial state of charge (SOC) |
required |
Raises:
Type | Description |
---|---|
Exception
|
if test not in ['accel', 'grade'] |
Source code in t3co/run/run_scenario.py
set_cargo_kg(analysis_vehicle: fastsim.vehicle.Vehicle, cargo_kg)
¶
This helper method is used within T3COProblem to set cargo_kg to optimization vehicle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
cargo_kg
|
float
|
vehicle cargo capacity /kg |
required |
Source code in t3co/run/run_scenario.py
set_fuel_store_kwh(analysis_vehicle: fastsim.vehicle.Vehicle, fs_kwh: float) -> None
¶
This helper method is used within T3COProblem to set fs_kwh to optimization vehicle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
fs_kwh
|
float
|
fuel storage energy capacity /kWh |
required |
Source code in t3co/run/run_scenario.py
set_max_battery_kwh(analysis_vehicle: fastsim.vehicle.Vehicle, max_ess_kwh: float) -> None
¶
This helper method is used within T3COProblem to set max_ess_kwh to optimization vehicle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
max_ess_kwh
|
float
|
max energy storage system energy capacity /kWh |
required |
Source code in t3co/run/run_scenario.py
set_max_battery_power_kw(analysis_vehicle: fastsim.vehicle.Vehicle, max_ess_kw: float) -> None
¶
This helper method is used within T3COProblem to set max_ess_kwx to optimization vehicle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
max_ess_kw
|
float
|
max energy storage system power /kW |
required |
Source code in t3co/run/run_scenario.py
set_max_fuel_converter_kw(analysis_vehicle: fastsim.vehicle.Vehicle, fc_max_out_kw: float) -> None
¶
This helper method is used within T3COProblem to set fc_max_out_kw to optimization vehicle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
fc_max_out_kw
|
float
|
max fuel converter power /kW |
required |
Source code in t3co/run/run_scenario.py
set_max_motor_kw(analysis_vehicle: fastsim.vehicle.Vehicle, scenario: Scenario, max_motor_kw: float) -> None
¶
This helper method is used within T3COProblem to set max_motor_kw to optimization vehicle and set kw_demand_fc_on if PHEV
Parameters:
Name | Type | Description | Default |
---|---|---|---|
analysis_vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
scenario
|
run_scenario.Scenario
|
T3CO Scenarion object |
required |
max_motor_kw
|
float
|
max motor power /kW |
required |
Source code in t3co/run/run_scenario.py
set_test_weight(vehicle: fastsim.vehicle.Vehicle, scenario: Scenario) -> None
¶
assign standardized vehicle mass for accel and grade test using GVWR and GVWR Credit
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object |
required |
scenario
|
t3co.run_scenario.Scenario
|
T3CO scenario object |
required |
Source code in t3co/run/run_scenario.py
vehicle_scenario_sweep(vehicle: fastsim.vehicle.Vehicle, scenario: Scenario, range_cyc, verbose=False, **kwargs)
¶
This function contains helper methods such as get_tco_of_vehicle, check_phev_init_socs, get_accel, and get_gradeability and returns a dictionary of all TCO related outputs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vehicle
|
fastsim.vehicle.Vehicle
|
FASTSim vehicle object for current selection |
required |
scenario
|
Scenario
|
Scenario object for current selection |
required |
range_cyc
|
fastsim.cycle.Cycle
|
FASTSim cycle object for current scenario |
required |
verbose
|
bool
|
if selected, prints out the TCO calculation process. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
out |
dict
|
output dictionary containing TCO elements |
Source code in t3co/run/run_scenario.py
Python | |
---|---|
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 |
|