Skip to content

Commit

Permalink
Merge pull request #102 from Total-RD/halev_dev_control
Browse files Browse the repository at this point in the history
undo accidental delete of _record_co2
  • Loading branch information
ahalev authored Mar 16, 2022
2 parents 52c3627 + 0071e20 commit 693fdcc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/pymgrid/Microgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,22 @@ def _record_production(self, control_dict, production_dict, status):

return production_dict

def _record_co2(self, control_dict, df, grid_co2=0):
""" This function record the cost of operating the microgrid at each time step."""
co2 = 0

if self.architecture['genset'] == 1:
co2 += control_dict['genset'] * self.parameters['genset_co2'].values[0]

if self.architecture['grid'] == 1:
co2 += grid_co2 * control_dict['grid_import']

cost_dict = {'co2': co2}

df['co2'].append( co2)

return df

def _record_cost(self, control_dict, df, df_co2, cost_import=0, cost_export=0):
""" This function record the cost of operating the microgrid at each time step."""

Expand Down

0 comments on commit 693fdcc

Please sign in to comment.