Make storage_cost configurable

This commit is contained in:
Aart van Halteren
2022-01-11 15:38:34 +01:00
parent 28a806f584
commit 3ed8ea5f8a
2 changed files with 5 additions and 5 deletions

View File

@@ -6,8 +6,8 @@ class Cost
attr_accessor :max_charge_kwh
attr_reader :battery, :entsoe
def initialize(battery_capacity=10.0, max_charge=5.0)
@entsoe = Entsoe.new
def initialize(battery_capacity=10.0, max_charge=5.0, storage_cost=0.05)
@entsoe = Entsoe.new(storage_cost)
@max_charge_kwh = max_charge
@battery = Battery.new(battery_capacity)
end
@@ -197,7 +197,7 @@ class Cost
oxxio_rate,
oxxio_cost]
p "%s,%s,%s,%s,%s,%s,%s,%0.02f,%s,%s,%s,%s,%s" % (one_hour[0..7] + one_hour[8..12].map{|c| format_cost(c)})
p "%s,%s,%s,%s,%s,%s,%s,%0.1f,%s,%s,%s,%s,%s" % (one_hour[0..7] + one_hour[8..12].map{|c| format_cost(c)})
result << one_hour
hour_start = hour_start.advance(:hours => 1)