Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load flexibility yingli #1331

Open
wants to merge 8 commits into
base: load_flexibility
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions measures/ResStockArgumentsPostHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,22 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDescription('Absolute/relative path of the HPXML file.')
args << arg

# Add args for flexibility inputs. Use hours format for the duration and minutes for the random offset. Offsets are degree F.
arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('loadflex_peak_duration_hours', false)
arg.setDisplayName('Load Flexibility: Peak Duration (hours)')
arg.setDescription('Duration of the peak period in hours.')
arg.setDefaultValue(0)
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('loadflex_peak_offset', false)
arg.setDisplayName('Load Flexibility: Peak Offset (deg F)')
arg.setDescription('Offset of the peak period in degrees Fahrenheit.')
arg.setDefaultValue(0)
arg.setDefaultValue(2)
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('loadflex_pre_peak_duration_hours', false)
arg.setDisplayName('Load Flexibility: Pre-Peak Duration (hours)')
arg.setDescription('Duration of the pre-peak period in hours.')
arg.setDefaultValue(0)
arg.setDefaultValue(2)
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('loadflex_pre_peak_offset', false)
arg.setDisplayName('Load Flexibility: Pre-Peak Offset (deg F)')
arg.setDescription('Offset of the pre-peak period in degrees Fahrenheit.')
arg.setDefaultValue(0)
arg.setDefaultValue(3)
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('loadflex_random_shift_minutes', false)
Expand Down Expand Up @@ -123,7 +116,7 @@ def run(model, runner, user_arguments)
end

def skip_load_flexibility?(args)
args[:loadflex_peak_duration_hours] == 0 && args[:loadflex_pre_peak_duration_hours] == 0
args[:loadflex_peak_offset] == 0 && args[:loadflex_pre_peak_duration_hours] == 0
end

def create_schedule(hpxml, hpxml_path, runner, building_index)
Expand Down Expand Up @@ -154,7 +147,6 @@ def get_flexibility_inputs(args, minutes_per_step, building_id)
max_random_shift_steps = (args[:loadflex_random_shift_minutes] / minutes_per_step).to_i
random_shift_steps = rand(-max_random_shift_steps..max_random_shift_steps)
FlexibilityInputs.new(
peak_duration_steps: args[:loadflex_peak_duration_hours] * 60 / minutes_per_step,
peak_offset: args[:loadflex_peak_offset],
pre_peak_duration_steps: args[:loadflex_pre_peak_duration_hours] * 60 / minutes_per_step,
pre_peak_offset: args[:loadflex_pre_peak_offset],
Expand Down
Loading
Loading