Make storage_cost configurable
This commit is contained in:
@@ -6,8 +6,8 @@ class Cost
|
|||||||
attr_accessor :max_charge_kwh
|
attr_accessor :max_charge_kwh
|
||||||
attr_reader :battery, :entsoe
|
attr_reader :battery, :entsoe
|
||||||
|
|
||||||
def initialize(battery_capacity=10.0, max_charge=5.0)
|
def initialize(battery_capacity=10.0, max_charge=5.0, storage_cost=0.05)
|
||||||
@entsoe = Entsoe.new
|
@entsoe = Entsoe.new(storage_cost)
|
||||||
@max_charge_kwh = max_charge
|
@max_charge_kwh = max_charge
|
||||||
@battery = Battery.new(battery_capacity)
|
@battery = Battery.new(battery_capacity)
|
||||||
end
|
end
|
||||||
@@ -197,7 +197,7 @@ class Cost
|
|||||||
oxxio_rate,
|
oxxio_rate,
|
||||||
oxxio_cost]
|
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
|
result << one_hour
|
||||||
|
|
||||||
hour_start = hour_start.advance(:hours => 1)
|
hour_start = hour_start.advance(:hours => 1)
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ class Entsoe
|
|||||||
attr_accessor :no_grid_charge_months
|
attr_accessor :no_grid_charge_months
|
||||||
attr_reader :storage_cost
|
attr_reader :storage_cost
|
||||||
|
|
||||||
def initialize(api_key = "c2287e07-0c26-4950-b430-22b7f75a8f2e")
|
def initialize(storage_cost = 0.05, api_key = "c2287e07-0c26-4950-b430-22b7f75a8f2e")
|
||||||
@api_key = api_key
|
@api_key = api_key
|
||||||
@kwh_prices = {}
|
@kwh_prices = {}
|
||||||
@storage_cost = 0.05 # how much does it cost to store 1 kwh in battery
|
@storage_cost = storage_cost # how much does it cost to store 1 kwh in battery
|
||||||
@no_grid_charge_months = [5,6,7] # months where we assume there is enough surplus from sun power
|
@no_grid_charge_months = [5,6,7] # months where we assume there is enough surplus from sun power
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user