naohiro701 commited on
Commit
ade33aa
·
verified ·
1 Parent(s): 0e60608

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -188,23 +188,23 @@ if st.button("Run MGA Optimization"):
188
  alternative_solutions = optimize_energy_system(city_code, solar_cost, onshore_wind_cost, offshore_wind_cost, river_cost, battery_cost, yearly_demand, solar_range, wind_range, river_range, offshore_wind_range, [t / 100 for t in thresholds], selected_technologies)
189
 
190
  if alternative_solutions:
191
- # コスト積み上げ用データの収集
192
- cost_data = []
193
- for sol in alternative_solutions:
194
- cost_data.append({
195
- 'threshold': sol['threshold'] * 100,
196
- 'type': sol['type'],
197
- 'technology': sol['technology'],
198
- 'total_cost': sol['total_cost']
199
- })
200
-
201
- # コスト積み上げグラフのプロット
202
- cost_df = pd.DataFrame(cost_data)
203
- fig_cost = px.bar(cost_df, x='threshold', y='total_cost', color='technology', title="Cost Breakdown by Technology and Threshold")
204
- fig_cost.update_layout(xaxis_title='Threshold (%)', yaxis_title='Total Cost (¥)')
205
-
206
- # Streamlitでコスト積み上げグラフを表示
207
- st.plotly_chart(fig_cost, use_container_width=True)
208
 
209
  # 各技術ごとに異なる色を指定
210
  colors = {
 
188
  alternative_solutions = optimize_energy_system(city_code, solar_cost, onshore_wind_cost, offshore_wind_cost, river_cost, battery_cost, yearly_demand, solar_range, wind_range, river_range, offshore_wind_range, [t / 100 for t in thresholds], selected_technologies)
189
 
190
  if alternative_solutions:
191
+ # # コスト積み上げ用データの収集
192
+ # cost_data = []
193
+ # for sol in alternative_solutions:
194
+ # cost_data.append({
195
+ # 'threshold': sol['threshold'] * 100,
196
+ # 'type': sol['type'],
197
+ # 'technology': sol['technology'],
198
+ # 'total_cost': sol['total_cost']
199
+ # })
200
+
201
+ # # コスト積み上げグラフのプロット
202
+ # cost_df = pd.DataFrame(cost_data)
203
+ # fig_cost = px.bar(cost_df, x='threshold', y='total_cost', color='technology', title="Cost Breakdown by Technology and Threshold")
204
+ # fig_cost.update_layout(xaxis_title='Threshold (%)', yaxis_title='Total Cost (¥)')
205
+
206
+ # # Streamlitでコスト積み上げグラフを表示
207
+ # st.plotly_chart(fig_cost, use_container_width=True)
208
 
209
  # 各技術ごとに異なる色を指定
210
  colors = {