Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
# Omnisafe runs
**/runs/*

# Installation artifacts
**/*.egg-info/*
**/.vscode/*

# Bash scripts
**/*.sh

# Experiments and wandb
**/tea_debug.log
**/wandb/*
Expand Down
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,24 @@ We recommend using a [Miniconda](https://www.anaconda.com/docs/getting-started/m
```bash
git clone https://github.com/Isla-lab/LivingLab.git
```
2. Setup [Omnisafe](https://github.com/PKU-Alignment/omnisafe):
2. Create and activate a miniconda environment:
```bash
# 1. Create the conda environment
cd LivingLab/ext/omnisafe
conda env create --file conda-recipe.yaml

# 2. Install omnisafe
conda activate safe-livinglab
conda create -n livinglab python==3.10 -y
conda activate livinglab
```
3. Setup `LivingLab`:
```bash
cd LivingLab/
pip install -e .
```
3. Update and install additional libraries
4. Setup [Omnisafe](https://github.com/PKU-Alignment/omnisafe):
```bash
# 1. Update torch and torchvision
pip install torch==2.8.0 torchvision==0.23.0

# 2. Install utilities
pip install ipywidgets
pip install ladybug-core
pip install stable_baselines3==2.0.0
cd ext/omnisafe
pip install -e .
```

## 2. 🚀 Quick Start
You can easily use the environment by importing it and and calling calling `.gym.make()`.
You can easily use the environment by importing it and and calling calling `gym.make()`.
```python
import gymnasium as gym
import livinglab # Registers the environment with default configurations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"active": true
},
"comfort_band": {
"active": false
"active": true
},
"cooling_demand": {
"active": false
Expand All @@ -67,6 +67,15 @@
"active": false
},
"electricity_pricing": {
"active": true
},
"electricity_pricing_predicted_1": {
"active": true
},
"electricity_pricing_predicted_2": {
"active": false
},
"electricity_pricing_predicted_3": {
"active": false
},
"carbon_intensity": {
Expand All @@ -75,6 +84,12 @@
"thermal_battery_soc": {
"active": true
},
"energy_from_battery": {
"active": true
},
"energy_from_heat_pump": {
"active": true
},
"net_electricity_consumption": {
"active": false
},
Expand Down Expand Up @@ -149,9 +164,16 @@
0.9749279,
1.0,
43.536755
]
],
"reset_on_ep_start": true
},
"periodic_normalization": true,
"thermal_demand_propagation": 1,
"random_ep_reset": false,
"render_cfgs": {
"mode": "off",
"dir": "../render"
},
"reward_fn": {
"class": "ComfortRewardFunction"
}
Expand Down
180 changes: 180 additions & 0 deletions config/citylearn_challenge_2023_Building2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"seed": 42,
"sim_data_paths": {
"energy_simulation": "/datasets/citylearn_challenge_2023_phase_1/Building_2.csv",
"weather": "/datasets/citylearn_challenge_2023_phase_1/weather.csv",
"pricing": "/datasets/citylearn_challenge_2023_phase_1/pricing.csv",
"carbon_intensity": "/datasets/citylearn_challenge_2023_phase_1/carbon_intensity.csv"
},
"start_time_step": 0,
"end_time_step": 719,
"observations_metadata": {
"hour": {
"active": true,
"periodic_metadata": {
"min": 1,
"max": 24
}
},
"day_type": {
"active": false,
"periodic_metadata": {
"min": 1,
"max": 7
}
},
"month": {
"active": false,
"periodic_metadata": {
"min": 1,
"max": 12
}
},
"indoor_dry_bulb_temperature": {
"active": true
},
"indoor_relative_humidity": {
"active": false
},
"occupant_count": {
"active": false
},
"indoor_dry_bulb_temperature_cooling_set_point": {
"active": true
},
"comfort_band": {
"active": true
},
"cooling_demand": {
"active": false
},
"non_shiftable_load": {
"active": false
},
"solar_generation": {
"active": false
},
"outdoor_dry_bulb_temperature": {
"active": true
},
"outdoor_relative_humidity": {
"active": false
},
"diffuse_solar_irradiance": {
"active": false
},
"direct_solar_irradiance": {
"active": false
},
"electricity_pricing": {
"active": true
},
"electricity_pricing_predicted_1": {
"active": true
},
"electricity_pricing_predicted_2": {
"active": false
},
"electricity_pricing_predicted_3": {
"active": false
},
"carbon_intensity": {
"active": false
},
"thermal_battery_soc": {
"active": true
},
"energy_from_battery": {
"active": true
},
"energy_from_heat_pump": {
"active": true
},
"net_electricity_consumption": {
"active": false
},
"underground_temperature": {
"active": true
}
},
"heat_pump_cfgs": {
"nominal_power": 2.25,
"efficiency": 0.29,
"mode": "cooling",
"target_temperature": 6.0,
"tank_depth": 5.0,
"soil_alpha": 0.052,
"kasuda_data": "../data/datasets/citylearn_challenge_2023_phase_1/USA_TX_San.Antonio.Intl.AP.722530_TMY3.epw"
},
"thermal_battery_cfgs": {
"capacity": 4.0,
"efficiency": 0.95,
"loss_coef": 1e-05
},
"pv_system_cfgs": {
"nominal_power": 1.2
},
"dynamics_cfgs": {
"path": "/datasets/citylearn_challenge_2023_phase_1/Building_2.pth",
"num_layers": 2,
"input_size": 13,
"hidden_size": 16,
"lookback": 12,
"input_observation_names": [
"direct_solar_irradiance",
"diffuse_solar_irradiance",
"outdoor_dry_bulb_temperature",
"indoor_dry_bulb_temperature_cooling_set_point",
"occupant_count",
"cooling_demand",
"month_sin",
"month_cos",
"hour_sin",
"hour_cos",
"day_type_sin",
"day_type_cos",
"indoor_dry_bulb_temperature"
],
"input_norm_min": [
0.0,
0.0,
21.7,
20.444445,
0.0,
0.0,
-0.8660254,
-1.0,
-1.0,
-1.0,
-0.9749279,
-0.90096885,
16.119997
],
"input_norm_max": [
931.0,
486.5,
42.8,
26.666666,
1.0,
11.077426,
1.2246469000000002e-16,
-0.5,
1.0,
1.0,
0.9749279,
1.0,
42.521355
],
"reset_on_ep_start": true
},
"periodic_normalization": true,
"thermal_demand_propagation": 1,
"random_ep_reset": false,
"render_cfgs": {
"mode": "off",
"dir": "./render"
},
"reward_fn": {
"class": "ComfortRewardFunction"
}
}
Loading