Sha256: 5c73fb733831e2752ff1f30e3e57c48f92c43312e5e6b0f215b15a5d8fc269b0

Contents?: true

Size: 1011 Bytes

Versions: 26

Compression:

Stored size: 1011 Bytes

Contents

class Standard
  # @!group ScheduleCompact

  # Returns the min and max value for this schedule.
  #
  # @author Andrew Parker, NREL.
  # return [Hash] Hash has two keys, min and max.
  def schedule_compact_annual_min_max_value(schedule_compact)
    vals = []
    prev_str = ''
    sch.extensibleGroups.each do |eg|
      if prev_str.include?('until')
        val = eg.getDouble(0)
        if val.is_initialized
          vals << eg.getDouble(0).get
        end
      end
      str = eg.getString(0)
      if str.is_initialized
        prev_str = str.get.downcase
      end
    end

    # Error if no values were found
    if vals.size.zero?
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.ScheduleCompact', "Could not find any value in #{schedule_compact.name} when determining min and max.")
      result = { 'min' => 999.9, 'max' => 999.9 }
      return result
    end

    result = { 'min' => vals.min, 'max' => vals.max }

    return result
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
openstudio-standards-0.2.12 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc7 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc6 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc5 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc4 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc2 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.12.rc1 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.11 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.11.rc2 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.11.rc1 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.10 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.10.rc3 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.10.rc2 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.10.rc1 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.9 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.8 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.7 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.6 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.5 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb
openstudio-standards-0.2.4 lib/openstudio-standards/standards/Standards.ScheduleCompact.rb