Skip to content

Commit

Permalink
renamed cop observations as efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleynweye committed Mar 17, 2024
1 parent c3b6c48 commit c738853
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 24 deletions.
5 changes: 3 additions & 2 deletions assets/tables/citylearn_observations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
"Building",":code:`electricity_pricing_predicted_6h`",":file:`pricing.csv`","$/kWh","Electricity rate predicted 6 hours ahead."
"Building",":code:`electricity_pricing_predicted_12h`",":file:`pricing.csv`","$/kWh","Electricity rate predicted 12 hours ahead."
"Building",":code:`electricity_pricing_predicted_24h`",":file:`pricing.csv`","$/kWh","Electricity rate predicted 24 hours ahead."
"Building",":code:`cooling_device_cop`","Runtime calculation","1",":code:`cooling_device` Carnot cycle COP based solely on temperature difference between heat source and sink."
"Building",":code:`heating_device_cop`","Runtime calculation","1",":code:`heating_device` Carnot cycle COP based solely on temperature difference between heat source and sink."
"Building",":code:`cooling_device_efficiency`","Runtime calculation","1",":code:`cooling_device` Carnot cycle COP based solely on temperature difference between heat source and sink."
"Building",":code:`heating_device_efficiency`","Runtime calculation","1",":code:`heating_device` Carnot cycle COP based solely on temperature difference between heat source and sink if heat pump else technical efficiency."
"Building",":code:`dhw_device_efficiency`","Runtime calculation","1",":code:`dhw_device` Carnot cycle COP based solely on temperature difference between heat source and sink if heat pump else technical efficiency."
"Building",":code:`cooling_demand`",":file:`building_id.csv`/Runtime calculation","kWh","Cooling energy supplied by :code:`cooling_device` and :code:`cooling_storage` for space cooling."
"Building",":code:`heating_demand`",":file:`building_id.csv`/Runtime calculation","kWh","Heating energy supplied by :code:`heating_device` and :code:`heating_storage` for space heating."
"Building",":code:`dhw_demand`",":file:`building_id.csv`/Runtime calculation","kWh","Heating energy supplied by :code:`dhw_device` and :code:`dhw_storage` for DHW heating."
Expand Down
20 changes: 16 additions & 4 deletions citylearn/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,10 +822,13 @@ def observations(self, include_all: bool = None, normalize: bool = None, periodi
'heating_storage_electricity_consumption': self.heating_storage_electricity_consumption[self.time_step],
'dhw_storage_electricity_consumption': self.dhw_storage_electricity_consumption[self.time_step],
'electrical_storage_electricity_consumption': self.electrical_storage_electricity_consumption[self.time_step],
'cooling_device_cop': self.cooling_device.get_cop(self.weather.outdoor_dry_bulb_temperature[self.time_step], heating=False),
'heating_device_cop': self.heating_device.get_cop(
'cooling_device_efficiency': self.cooling_device.get_cop(self.weather.outdoor_dry_bulb_temperature[self.time_step], heating=False),
'heating_device_efficiency': self.heating_device.get_cop(
self.weather.outdoor_dry_bulb_temperature[self.time_step], heating=True
) if isinstance(self.heating_device, HeatPump) else self.heating_device.efficiency,
'dhw_device_efficiency': self.dhw_device.get_cop(
self.weather.outdoor_dry_bulb_temperature[self.time_step], heating=True
) if isinstance(self.dhw_device, HeatPump) else self.dhw_device.efficiency,
'indoor_dry_bulb_temperature_set_point': self.energy_simulation.indoor_dry_bulb_temperature_set_point[self.time_step],
'indoor_dry_bulb_temperature_delta': abs(self.energy_simulation.indoor_dry_bulb_temperature[self.time_step] - self.energy_simulation.indoor_dry_bulb_temperature_set_point[self.time_step]),
'occupant_count': self.energy_simulation.occupant_count[self.time_step],
Expand Down Expand Up @@ -1277,12 +1280,12 @@ def estimate_observation_space_limits(self, include_all: bool = None, periodic_n
low_limit[key] = 0.0
high_limit[key] = 1.0

elif key in ['cooling_device_cop']:
elif key in ['cooling_device_efficiency']:
cop = self.cooling_device.get_cop(data['outdoor_dry_bulb_temperature'], heating=False)
low_limit[key] = min(cop)
high_limit[key] = max(cop)

elif key in ['heating_device_cop']:
elif key in ['heating_device_efficiency']:
if isinstance(self.heating_device, HeatPump):
cop = self.heating_device.get_cop(data['outdoor_dry_bulb_temperature'], heating=True)
low_limit[key] = min(cop)
Expand All @@ -1291,6 +1294,15 @@ def estimate_observation_space_limits(self, include_all: bool = None, periodic_n
low_limit[key] = self.heating_device.efficiency
high_limit[key] = self.heating_device.efficiency

elif key in ['dhw_device_efficiency']:
if isinstance(self.dhw_device, HeatPump):
cop = self.dhw_device.get_cop(data['outdoor_dry_bulb_temperature'], heating=True)
low_limit[key] = min(cop)
high_limit[key] = max(cop)
else:
low_limit[key] = self.dhw_device.efficiency
high_limit[key] = self.dhw_device.efficiency

elif key == 'indoor_dry_bulb_temperature':
low_limit[key] = data['indoor_dry_bulb_temperature'].min() - self.maximum_temperature_delta
high_limit[key] = data['indoor_dry_bulb_temperature'].max() + self.maximum_temperature_delta
Expand Down
4 changes: 2 additions & 2 deletions citylearn/data/baeda_3dem/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": true,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
4 changes: 2 additions & 2 deletions citylearn/data/citylearn_challenge_2023_phase_1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
4 changes: 2 additions & 2 deletions citylearn/data/citylearn_challenge_2023_phase_3_1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
4 changes: 2 additions & 2 deletions citylearn/data/citylearn_challenge_2023_phase_3_2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down
4 changes: 2 additions & 2 deletions citylearn/data/citylearn_challenge_2023_phase_3_3/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@
"active": true,
"shared_in_central_agent": true
},
"cooling_device_cop": {
"cooling_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
"heating_device_cop": {
"heating_device_efficiency": {
"active": false,
"shared_in_central_agent": false
},
Expand Down

0 comments on commit c738853

Please sign in to comment.