Class: EnergyPlus::StatFile

Inherits:
Object
  • Object
show all
Defined in:
lib/measures/ChangeBuildingLocation/resources/stat_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ StatFile

Returns a new instance of StatFile.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 22

def initialize(path)
  @path = Pathname.new(path)
  @valid = false
  @lat = []
  @lon = []
  @gmt = []
  @elevation = []
  @hdd18 = []
  @cdd18 = []
  @hdd10 = []
  @cdd10 = []
  @monthly_dry_bulb = []
  @delta_dry_bulb = []
  init
end

Instance Attribute Details

#cdd10Object

Returns the value of attribute cdd10.



20
21
22
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 20

def cdd10
  @cdd10
end

#cdd18Object

Returns the value of attribute cdd18.



18
19
20
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 18

def cdd18
  @cdd18
end

#elevationObject

Returns the value of attribute elevation.



14
15
16
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 14

def elevation
  @elevation
end

#gmtObject

Returns the value of attribute gmt.



15
16
17
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 15

def gmt
  @gmt
end

#hdd10Object

Returns the value of attribute hdd10.



19
20
21
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 19

def hdd10
  @hdd10
end

#hdd18Object

Returns the value of attribute hdd18.



17
18
19
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 17

def hdd18
  @hdd18
end

#latObject

Returns the value of attribute lat.



12
13
14
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 12

def lat
  @lat
end

#lonObject

Returns the value of attribute lon.



13
14
15
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 13

def lon
  @lon
end

#monthlyDBObject

Returns the value of attribute monthlyDB.



16
17
18
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 16

def monthlyDB
  @monthlyDB
end

#pathObject

Returns the value of attribute path.



10
11
12
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 10

def path
  @path
end

#validObject

Returns the value of attribute valid.



11
12
13
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 11

def valid
  @valid
end

Instance Method Details

#delta_dry_bulbObject

max - min of the mean monthly dry bulbs



56
57
58
59
60
61
62
63
64
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 56

def delta_dry_bulb
  if !@monthly_dry_bulb.empty?
    delta_t = @monthly_dry_bulb.max - @monthly_dry_bulb.min
  else
    delta_t = ''
  end

  delta_t.to_f
end

#mean_dry_bulbObject

the mean of the mean monthly dry bulbs



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 43

def mean_dry_bulb
  if !@monthly_dry_bulb.empty?
    sum = 0
    @monthly_dry_bulb.each { |db| sum += db }
    mean = sum / @monthly_dry_bulb.size
  else
    mean = ''
  end

  mean.to_f
end

#valid?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/measures/ChangeBuildingLocation/resources/stat_file.rb', line 38

def valid?
  return @valid
end