Skip to content

Commit

Permalink
breaker spaces headroom
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingli committed Oct 29, 2024
1 parent 85d948c commit 1860f90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion measures/ResStockArguments/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def run(model, runner, user_arguments)
# FIXME: uncomment these once we pull in OS-HPXML's electric_panel branch
breaker_spaces_headroom = capacity_sampler.assign_breaker_spaces_headroom(args: args)
args[:electric_panel_breaker_spaces_type] = 'headroom'
args[:electric_panel_breaker_spaces] = breaker_spaces_headroom # Yingli
args[:electric_panel_breaker_spaces] = breaker_spaces_headroom

# Register values to runner
args.each do |arg_name, arg_value|
Expand Down
8 changes: 6 additions & 2 deletions measures/ResStockArguments/resources/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,15 @@ module Constants
ArgumentsToRegister = ['heating_unavailable_period',
'cooling_unavailable_period',
'electric_panel_service_rating_bin',
'electric_panel_service_rating']
'electric_panel_service_rating',
'electric_panel_breaker_spaces_type',
'electric_panel_breaker_spaces']

# List of ResStockArguments arguments; will not be passed into BuildResidentialHPXML
ArgumentsToExclude = ['heating_unavailable_period',
'cooling_unavailable_period',
'electric_panel_service_rating_bin',
'electric_panel_service_rating'] # FIXME: temporarily exclude this last one until we pull in OS-HPXML's electric_panel branch
'electric_panel_service_rating',
'electric_panel_breaker_spaces_type',
'electric_panel_breaker_spaces'] # FIXME: temporarily exclude this last one until we pull in OS-HPXML's electric_panel branch
end
9 changes: 4 additions & 5 deletions measures/ResStockArguments/resources/electrical_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ def sample_breaker_spaces_headroom(prng, breaker_spaces_headroom_prob_map, args)
# emulate HVAC Cooling Type
hvac_cooling_type = convert_cooling_type(args[:cooling_system_type], args[:heat_pump_type])
# emulate HVAC Heating Type
hvac_heating_type = convert_heating_type(args[:heating_system_type], args[:heat_pump_type])
hvac_heating_type = convert_heating_type(args[:heat_pump_type])

# simplify appliance presence and fuel
clothes_dryer = convert_fuel_and_presence(args[:clothes_dryer_present], args[:clothes_dryer_fuel_type])
cooking_range = convert_fuel_and_presence(args[:cooking_range_oven_present], args[:cooking_range_fuel_type])
water_heater_fuel_type = simplify_fuel_type(args[:water_heater_fuel_type])
heating_fuel_type = simplify_fuel_type(args[:heating_system_fuel])
ev_charger_present = FALSE
ev_charger_present = 'FALSE'

lookup_array = [
hvac_cooling_type,
Expand All @@ -101,11 +101,10 @@ def sample_breaker_spaces_headroom(prng, breaker_spaces_headroom_prob_map, args)
water_heater_fuel_type,
clothes_dryer,
cooking_range,
args[:pv_system_present].to_s,
args[:pv_system_present].to_s.upcase,
ev_charger_present.to_s,
cap_bin,
cap_bin.to_s,
]
end
breaker_spaces_headroom = get_row_headers_breaker_spaces_headroom(breaker_spaces_headroom_prob_map, lookup_array)
row_probability = get_row_probability_breaker_spaces_headroom(breaker_spaces_headroom_prob_map, lookup_array)
index = weighted_random(prng, row_probability)
Expand Down

0 comments on commit 1860f90

Please sign in to comment.