Daniel Varga commited on
Commit
200f45c
1 Parent(s): 376d985

pricing in app

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -8,6 +8,7 @@ import gradio as gr
8
  from simulation import *
9
  from data_processing import *
10
  from visualization import *
 
11
 
12
 
13
  #@title ### Downloading the data
@@ -51,6 +52,13 @@ def ui_refresh(solar_cell_num, bess_nominal_capacity, fixed_consumption):
51
  html = "<table>\n"
52
  for column, column_name in zip((network, solar, bess), ("Network", "Solar directly", "Solar via BESS")):
53
  html += f"<tr><td>Yearly consumption served by {column_name}:&nbsp;&nbsp;&nbsp;</td><td>{column:0.2f} MWh</td></tr>\n"
 
 
 
 
 
 
 
54
  html += "</table>"
55
 
56
  return (html, fig_monthly, fig1, fig2)
 
8
  from simulation import *
9
  from data_processing import *
10
  from visualization import *
11
+ from supplier import Supplier
12
 
13
 
14
  #@title ### Downloading the data
 
52
  html = "<table>\n"
53
  for column, column_name in zip((network, solar, bess), ("Network", "Solar directly", "Solar via BESS")):
54
  html += f"<tr><td>Yearly consumption served by {column_name}:&nbsp;&nbsp;&nbsp;</td><td>{column:0.2f} MWh</td></tr>\n"
55
+
56
+ supplier = Supplier(price=70) # HUF/kWh
57
+ supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=100)
58
+ supplier.set_demand_charge(peak_demand=100, surcharge_per_kw=1000)
59
+ fee = supplier.fee(results["consumption_from_network"])
60
+ html += f"<tr><td>{fee/1e6:.3f} million HUF billed by energy supplier</td></tr>\n"
61
+
62
  html += "</table>"
63
 
64
  return (html, fig_monthly, fig1, fig2)