diff --git a/docs/compilation/doctrees/environment.pickle b/docs/compilation/doctrees/environment.pickle index c617e8b017..efce107434 100644 Binary files a/docs/compilation/doctrees/environment.pickle and b/docs/compilation/doctrees/environment.pickle differ diff --git a/docs/compilation/doctrees/index.doctree b/docs/compilation/doctrees/index.doctree index 581388a5f8..d0c9b95ee1 100644 Binary files a/docs/compilation/doctrees/index.doctree and b/docs/compilation/doctrees/index.doctree differ diff --git a/docs/compilation/doctrees/nbsphinx/pages/notebooks/basic_example.ipynb b/docs/compilation/doctrees/nbsphinx/pages/notebooks/basic_example.ipynb index 12a92fc53e..1408148efd 100644 --- a/docs/compilation/doctrees/nbsphinx/pages/notebooks/basic_example.ipynb +++ b/docs/compilation/doctrees/nbsphinx/pages/notebooks/basic_example.ipynb @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "collapsed": false, "pycharm": { @@ -38,12 +38,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", - " logger.warn(\n", - "[2022-08-24 08:52:56,398] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", - "[2022-08-24 08:52:56,399] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", - "[2022-08-24 08:52:56,401] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", - "[2022-08-24 08:52:56,403] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n" + "[2022-10-03 10:34:41,697] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 10:34:41,697] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 10:34:41,699] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 10:34:41,699] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 10:34:41,700] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 10:34:41,700] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 10:34:41,702] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 10:34:41,702] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 10:34:41,703] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 10:34:41,703] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n" ] } ], @@ -72,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "collapsed": false, "pycharm": { @@ -85,27 +89,29 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:52:56,478] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", - "[2022-08-24 08:52:56,492] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-demo-v1-res1/Eplus-env-sub_run1\n" + "[2022-10-03 10:34:44,176] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 10:34:44,176] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 10:34:44,184] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-demo-v1-res3/Eplus-env-sub_run1\n", + "[2022-10-03 10:34:44,184] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-demo-v1-res3/Eplus-env-sub_run1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Reward: -0.3808358083250144 {'timestep': 1, 'time_elapsed': 900, 'year': 1991, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 7616.716166500288, 'total_power_no_units': -0.7616716166500288, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.99998783039325], 'out_temperature': 1.8, 'action_': [21, 21]}\n", - "Reward: -1907.7277939767475 {'timestep': 2976, 'time_elapsed': 2678400, 'year': 1991, 'month': 2, 'day': 1, 'hour': 0, 'total_power': 6074.240017973336, 'total_power_no_units': -0.6074240017973336, 'comfort_penalty': -3.1192635601846987, 'abs_comfort': 3.1192635601846987, 'temperatures': [16.8807364398153], 'out_temperature': -7.0, 'action_': [16, 29]}\n", - "Reward: -3585.4934187414906 {'timestep': 5664, 'time_elapsed': 5097600, 'year': 1991, 'month': 3, 'day': 1, 'hour': 0, 'total_power': 913.1570850309641, 'total_power_no_units': -0.09131570850309642, 'comfort_penalty': -0.7021712738831916, 'abs_comfort': 0.7021712738831916, 'temperatures': [19.29782872611681], 'out_temperature': 8.1, 'action_': [15, 30]}\n", - "Reward: -4752.940264075469 {'timestep': 8640, 'time_elapsed': 7776000, 'year': 1991, 'month': 4, 'day': 1, 'hour': 0, 'total_power': 2550.617218922648, 'total_power_no_units': -0.25506172189226484, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.99871397216555], 'out_temperature': 7.7, 'action_': [21, 24]}\n", - "Reward: -5560.830588831498 {'timestep': 11520, 'time_elapsed': 10368000, 'year': 1991, 'month': 5, 'day': 1, 'hour': 0, 'total_power': 1999.124803999265, 'total_power_no_units': -0.1999124803999265, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.98506510334393], 'out_temperature': 13.0, 'action_': [21, 21]}\n", - "Reward: -6284.020264489995 {'timestep': 14496, 'time_elapsed': 13046400, 'year': 1991, 'month': 6, 'day': 1, 'hour': 0, 'total_power': 410.8927633115007, 'total_power_no_units': -0.041089276331150074, 'comfort_penalty': -1.7705159780059887, 'abs_comfort': 1.7705159780059887, 'temperatures': [21.22948402199401], 'out_temperature': 18.4, 'action_': [21, 24]}\n", - "Reward: -9322.837829436405 {'timestep': 17376, 'time_elapsed': 15638400, 'year': 1991, 'month': 7, 'day': 1, 'hour': 0, 'total_power': 215.8190765300895, 'total_power_no_units': -0.02158190765300895, 'comfort_penalty': -1.608314422881719, 'abs_comfort': 1.608314422881719, 'temperatures': [21.39168557711828], 'out_temperature': 17.7, 'action_': [18, 27]}\n", - "Reward: -12636.627393394123 {'timestep': 20352, 'time_elapsed': 18316800, 'year': 1991, 'month': 8, 'day': 1, 'hour': 0, 'total_power': 5037.684551333462, 'total_power_no_units': -0.5037684551333462, 'comfort_penalty': -2.854158909419219, 'abs_comfort': 2.854158909419219, 'temperatures': [20.14584109058078], 'out_temperature': 20.6, 'action_': [20, 25]}\n", - "Reward: -15946.738203460833 {'timestep': 23328, 'time_elapsed': 20995200, 'year': 1991, 'month': 9, 'day': 1, 'hour': 0, 'total_power': 367.8874627648617, 'total_power_no_units': -0.03678874627648617, 'comfort_penalty': -2.54812468432662, 'abs_comfort': 2.54812468432662, 'temperatures': [20.45187531567338], 'out_temperature': 18.8, 'action_': [18, 27]}\n", - "Reward: -18806.826419277357 {'timestep': 26208, 'time_elapsed': 23587200, 'year': 1991, 'month': 10, 'day': 1, 'hour': 0, 'total_power': 186.5934720667916, 'total_power_no_units': -0.018659347206679163, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.33203794777814], 'out_temperature': 13.3, 'action_': [17, 28]}\n", - "Reward: -19743.85954501463 {'timestep': 29184, 'time_elapsed': 26265600, 'year': 1991, 'month': 11, 'day': 1, 'hour': 0, 'total_power': 186.5934720667916, 'total_power_no_units': -0.018659347206679163, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.71761367059368], 'out_temperature': 13.0, 'action_': [16, 29]}\n", - "Reward: -20805.360894738802 {'timestep': 32064, 'time_elapsed': 28857600, 'year': 1991, 'month': 12, 'day': 1, 'hour': 0, 'total_power': 5873.617289712576, 'total_power_no_units': -0.5873617289712576, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.42152536802113], 'out_temperature': 5.1, 'action_': [22, 22]}\n", - "Reward: -22566.62456817261 {'timestep': 35040, 'time_elapsed': 31536000, 'year': 1992, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 8311.608954955058, 'total_power_no_units': -0.8311608954955059, 'comfort_penalty': -1.823025839166501, 'abs_comfort': 1.823025839166501, 'temperatures': [18.1769741608335], 'out_temperature': -12.0, 'action_': [18, 27]}\n" + "Reward: -0.5342786322651261 {'timestep': 1, 'time_elapsed': 900, 'year': 1991, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 10685.57264530252, 'total_power_no_units': -1.0685572645302521, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.07553516208551], 'out_temperature': 1.8, 'action_': [20, 25]}\n", + "Reward: -2096.650684004998 {'timestep': 2976, 'time_elapsed': 2678400, 'year': 1991, 'month': 2, 'day': 1, 'hour': 0, 'total_power': 22381.61729417214, 'total_power_no_units': -2.2381617294172145, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.38054356822621], 'out_temperature': -7.0, 'action_': [22, 22]}\n", + "Reward: -4129.51464935589 {'timestep': 5664, 'time_elapsed': 5097600, 'year': 1991, 'month': 3, 'day': 1, 'hour': 0, 'total_power': 15385.40872994788, 'total_power_no_units': -1.538540872994788, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.7609838426557], 'out_temperature': 8.1, 'action_': [22, 23]}\n", + "Reward: -5456.861170390168 {'timestep': 8640, 'time_elapsed': 7776000, 'year': 1991, 'month': 4, 'day': 1, 'hour': 0, 'total_power': 152.4868953414246, 'total_power_no_units': -0.01524868953414246, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.36175169264276], 'out_temperature': 7.7, 'action_': [19, 26]}\n", + "Reward: -6369.63107682455 {'timestep': 11520, 'time_elapsed': 10368000, 'year': 1991, 'month': 5, 'day': 1, 'hour': 0, 'total_power': 11452.77842481337, 'total_power_no_units': -1.145277842481337, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.92062373146303], 'out_temperature': 13.0, 'action_': [22, 22]}\n", + "Reward: -7206.697072691755 {'timestep': 14496, 'time_elapsed': 13046400, 'year': 1991, 'month': 6, 'day': 1, 'hour': 0, 'total_power': 7167.389297121867, 'total_power_no_units': -0.7167389297121867, 'comfort_penalty': -1.0051047272114815, 'abs_comfort': 1.0051047272114815, 'temperatures': [21.99489527278852], 'out_temperature': 18.4, 'action_': [22, 22]}\n", + "Reward: -10140.504682784309 {'timestep': 17376, 'time_elapsed': 15638400, 'year': 1991, 'month': 7, 'day': 1, 'hour': 0, 'total_power': 175.7866568476675, 'total_power_no_units': -0.01757866568476675, 'comfort_penalty': -1.5118073073826288, 'abs_comfort': 1.5118073073826288, 'temperatures': [21.48819269261737], 'out_temperature': 17.7, 'action_': [17, 28]}\n", + "Reward: -13387.708048636228 {'timestep': 20352, 'time_elapsed': 18316800, 'year': 1991, 'month': 8, 'day': 1, 'hour': 0, 'total_power': 20512.72746048218, 'total_power_no_units': -2.051272746048218, 'comfort_penalty': -1.2097303255916003, 'abs_comfort': 1.2097303255916003, 'temperatures': [21.7902696744084], 'out_temperature': 20.6, 'action_': [22, 23]}\n", + "Reward: -16617.56445110482 {'timestep': 23328, 'time_elapsed': 20995200, 'year': 1991, 'month': 9, 'day': 1, 'hour': 0, 'total_power': 1549.646030459042, 'total_power_no_units': -0.1549646030459042, 'comfort_penalty': -2.001432470832661, 'abs_comfort': 2.001432470832661, 'temperatures': [20.99856752916734], 'out_temperature': 18.8, 'action_': [21, 24]}\n", + "Reward: -19436.64949597934 {'timestep': 26208, 'time_elapsed': 23587200, 'year': 1991, 'month': 10, 'day': 1, 'hour': 0, 'total_power': 152.4868953414246, 'total_power_no_units': -0.01524868953414246, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.46027669892315], 'out_temperature': 13.3, 'action_': [17, 28]}\n", + "Reward: -20485.674588514717 {'timestep': 29184, 'time_elapsed': 26265600, 'year': 1991, 'month': 11, 'day': 1, 'hour': 0, 'total_power': 11070.55398785253, 'total_power_no_units': -1.1070553987852532, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.89205415771582], 'out_temperature': 13.0, 'action_': [22, 22]}\n", + "Reward: -21651.044604241863 {'timestep': 32064, 'time_elapsed': 28857600, 'year': 1991, 'month': 12, 'day': 1, 'hour': 0, 'total_power': 12804.88321134125, 'total_power_no_units': -1.2804883211341251, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.89708886598514], 'out_temperature': 5.1, 'action_': [22, 23]}\n", + "Reward: -23670.083608180244 {'timestep': 35040, 'time_elapsed': 31536000, 'year': 1992, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 5021.427115579548, 'total_power_no_units': -0.5021427115579548, 'comfort_penalty': -1.7835436138003509, 'abs_comfort': 1.7835436138003509, 'temperatures': [18.21645638619965], 'out_temperature': -12.0, 'action_': [15, 30]}\n" ] } ], @@ -138,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "collapsed": false, "pycharm": { @@ -150,7 +156,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:53:06,644] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n" + "[2022-10-03 10:34:57,801] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 10:34:57,801] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n" ] } ], @@ -172,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": { "collapsed": false, "pycharm": { @@ -184,7 +191,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Mean reward: -0.6440246737491857 Cumulative reward: -22566.62456817261\n" + "Mean reward: -0.6755160847083577 Cumulative reward: -23670.083608180244\n" ] } ], @@ -205,11 +212,8 @@ } ], "metadata": { - "interpreter": { - "hash": "767d51c1340bd893661ea55ea3124f6de3c7a262a8b4abca0554b478b1e2ff90" - }, "kernelspec": { - "display_name": "Python 3.9.11 64-bit", + "display_name": "Python 3.10.4 64-bit", "language": "python", "name": "python3" }, @@ -224,6 +228,11 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a" + } } }, "nbformat": 4, diff --git a/docs/compilation/doctrees/nbsphinx/pages/notebooks/change_environment.ipynb b/docs/compilation/doctrees/nbsphinx/pages/notebooks/change_environment.ipynb index 965b21c571..0dc9a010d0 100644 --- a/docs/compilation/doctrees/nbsphinx/pages/notebooks/change_environment.ipynb +++ b/docs/compilation/doctrees/nbsphinx/pages/notebooks/change_environment.ipynb @@ -23,7 +23,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 9, "metadata": { "collapsed": false, "pycharm": { @@ -36,12 +36,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", - " logger.warn(\n", - "[2022-08-24 08:55:54,216] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", - "[2022-08-24 08:55:54,217] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", - "[2022-08-24 08:55:54,219] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", - "[2022-08-24 08:55:54,220] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:11,813] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:11,813] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:11,814] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:11,814] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:11,816] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:11,816] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:11,818] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:11,818] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:11,818] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:06:11,818] EPLUS_ENV_5Zone-hot-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", " logger.warn(\n" ] @@ -84,7 +88,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 10, "metadata": { "collapsed": false, "pycharm": { @@ -97,10 +101,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:55:55,088] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", - "[2022-08-24 08:55:55,089] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", - "[2022-08-24 08:55:55,091] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", - "[2022-08-24 08:55:55,093] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:15,333] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:15,333] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:15,334] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:15,334] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:15,336] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:15,336] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:15,337] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:15,337] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:15,338] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:06:15,338] EPLUS_ENV_5Zone-hot-continuous-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", " logger.warn(\n" ] @@ -145,24 +155,30 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:55:56,077] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", - "[2022-08-24 08:55:56,078] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", - "[2022-08-24 08:55:56,080] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", - "[2022-08-24 08:55:56,082] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:19,050] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:19,050] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:06:19,052] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:19,052] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:06:19,054] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:19,054] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:06:19,056] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:19,056] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:06:19,057] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:06:19,057] EPLUS_ENV_new_env_name_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", " logger.warn(\n" ] } ], "source": [ - "env = gym.make('Eplus-datacenter-cool-continuous-stochastic-v1', \n", + "env = gym.make('Eplus-5Zone-cool-continuous-stochastic-v1', \n", " weather_file='ESP_Granada.084190_SWEC.epw',\n", " weather_variability=(1.0,0.0,0.001),\n", " env_name='new_env_name',\n", @@ -189,46 +205,71 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:55:56,850] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", - "[2022-08-24 08:55:56,850] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", - "[2022-08-24 08:55:56,852] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", - "[2022-08-24 08:55:56,853] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", - "[2022-08-24 08:55:56,854] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", - "[2022-08-24 08:55:56,989] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-datacenter-cool-discrete-stochastic-v1-res1/Eplus-env-sub_run1\n" + "[2022-10-03 11:07:47,922] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:07:47,922] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:07:47,922] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:07:47,922] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:07:47,924] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:07:47,924] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:07:47,924] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:07:47,924] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:07:47,926] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:07:47,926] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:07:47,926] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:07:47,926] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:07:47,928] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:07:47,928] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:07:47,928] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:07:47,928] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:07:47,929] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:07:47,929] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:07:47,929] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:07:47,929] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:07:47,931] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:07:47,931] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:07:47,931] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:07:47,931] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:07:48,064] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-datacenter-cool-discrete-stochastic-v1-res4/Eplus-env-sub_run1\n", + "[2022-10-03 11:07:48,064] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-datacenter-cool-discrete-stochastic-v1-res4/Eplus-env-sub_run1\n", + "[2022-10-03 11:07:48,064] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-datacenter-cool-discrete-stochastic-v1-res4/Eplus-env-sub_run1\n", + "[2022-10-03 11:07:48,064] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-datacenter-cool-discrete-stochastic-v1-res4/Eplus-env-sub_run1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Reward: -0.18562950733969957 {'timestep': 1, 'time_elapsed': 900, 'year': 1991, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 3712.590146793991, 'total_power_no_units': -0.37125901467939915, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 1.495266997755121, 'action_': [16, 29, 16, 29]}\n", - "Reward: -676.8466963812559 {'timestep': 2976, 'time_elapsed': 2678400, 'year': 1991, 'month': 2, 'day': 1, 'hour': 0, 'total_power': 3962.959903637626, 'total_power_no_units': -0.3962959903637626, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 6.479715547683856, 'action_': [21, 21, 21, 21]}\n", - "Reward: -1251.9649146249287 {'timestep': 5664, 'time_elapsed': 5097600, 'year': 1991, 'month': 3, 'day': 1, 'hour': 0, 'total_power': 4984.806746157207, 'total_power_no_units': -0.49848067461572076, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 3.083224933271658, 'action_': [22, 23, 22, 23]}\n", - "Reward: -1856.1854810210355 {'timestep': 8640, 'time_elapsed': 7776000, 'year': 1991, 'month': 4, 'day': 1, 'hour': 0, 'total_power': 2542.049288786898, 'total_power_no_units': -0.25420492887868984, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 4.548597527242591, 'action_': [15, 30, 15, 30]}\n", - "Reward: -2639.3977262984713 {'timestep': 11520, 'time_elapsed': 10368000, 'year': 1991, 'month': 5, 'day': 1, 'hour': 0, 'total_power': 4389.048609776261, 'total_power_no_units': -0.43890486097762615, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 9.966961794846867, 'action_': [20, 25, 20, 25]}\n", - "Reward: -3540.0364337521905 {'timestep': 14496, 'time_elapsed': 13046400, 'year': 1991, 'month': 6, 'day': 1, 'hour': 0, 'total_power': 3962.959903637626, 'total_power_no_units': -0.3962959903637626, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 9.932837191979614, 'action_': [22, 23, 22, 23]}\n", - "Reward: -4966.8910724773705 {'timestep': 17376, 'time_elapsed': 15638400, 'year': 1991, 'month': 7, 'day': 1, 'hour': 0, 'total_power': 3641.533364330611, 'total_power_no_units': -0.36415333643306114, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 10.73759114382434, 'action_': [16, 29, 16, 29]}\n", - "Reward: -6970.456022185655 {'timestep': 20352, 'time_elapsed': 18316800, 'year': 1991, 'month': 8, 'day': 1, 'hour': 0, 'total_power': 7437.450634930504, 'total_power_no_units': -0.7437450634930505, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 12.01780444446879, 'action_': [21, 21, 21, 21]}\n", - "Reward: -9176.457187552995 {'timestep': 23328, 'time_elapsed': 20995200, 'year': 1991, 'month': 9, 'day': 1, 'hour': 0, 'total_power': 5205.826494047731, 'total_power_no_units': -0.5205826494047732, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 11.76682020349629, 'action_': [16, 29, 16, 29]}\n", - "Reward: -10831.128614483414 {'timestep': 26208, 'time_elapsed': 23587200, 'year': 1991, 'month': 10, 'day': 1, 'hour': 0, 'total_power': 3632.325833964732, 'total_power_no_units': -0.3632325833964732, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 7.408750045244985, 'action_': [16, 29, 16, 29]}\n", - "Reward: -11597.451824735388 {'timestep': 29184, 'time_elapsed': 26265600, 'year': 1991, 'month': 11, 'day': 1, 'hour': 0, 'total_power': 3545.041301484721, 'total_power_no_units': -0.3545041301484721, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 5.470256190305543, 'action_': [18, 27, 18, 27]}\n", - "Reward: -12205.38913036408 {'timestep': 32064, 'time_elapsed': 28857600, 'year': 1991, 'month': 12, 'day': 1, 'hour': 0, 'total_power': 4171.474946040738, 'total_power_no_units': -0.41714749460407385, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 4.252032348441579, 'action_': [22, 23, 22, 23]}\n", - "Reward: -12852.455174221925 {'timestep': 35040, 'time_elapsed': 31536000, 'year': 1992, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 5946.285403368743, 'total_power_no_units': -0.5946285403368743, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': -0.01419754187374211, 'action_': [21, 24, 21, 24]}\n", - "Episode 0 Mean reward: -0.36679381204974576 Cumulative reward: -12852.455174221925\n" + "Reward: -0.2153129771240179 {'timestep': 1, 'time_elapsed': 900, 'year': 1991, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 4306.259542480358, 'total_power_no_units': -0.4306259542480358, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 1.044000531676663, 'action_': [19, 26]}\n", + "Reward: -660.6448328594148 {'timestep': 2976, 'time_elapsed': 2678400, 'year': 1991, 'month': 2, 'day': 1, 'hour': 0, 'total_power': 4157.813830820063, 'total_power_no_units': -0.41578138308200635, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 8.755699132506065, 'action_': [18, 27]}\n", + "Reward: -1244.0392548144782 {'timestep': 5664, 'time_elapsed': 5097600, 'year': 1991, 'month': 3, 'day': 1, 'hour': 0, 'total_power': 4725.134398205902, 'total_power_no_units': -0.4725134398205902, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 3.388003680767862, 'action_': [20, 25]}\n", + "Reward: -1847.362623921392 {'timestep': 8640, 'time_elapsed': 7776000, 'year': 1991, 'month': 4, 'day': 1, 'hour': 0, 'total_power': 2049.570777765625, 'total_power_no_units': -0.2049570777765625, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 4.552775270130963, 'action_': [16, 29]}\n", + "Reward: -2618.1218338983613 {'timestep': 11520, 'time_elapsed': 10368000, 'year': 1991, 'month': 5, 'day': 1, 'hour': 0, 'total_power': 3959.276280160218, 'total_power_no_units': -0.3959276280160218, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 10.11681786642924, 'action_': [17, 28]}\n", + "Reward: -3518.8119994042654 {'timestep': 14496, 'time_elapsed': 13046400, 'year': 1991, 'month': 6, 'day': 1, 'hour': 0, 'total_power': 3962.959903637627, 'total_power_no_units': -0.39629599036376273, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 9.942164036459882, 'action_': [22, 23]}\n", + "Reward: -4987.145205583042 {'timestep': 17376, 'time_elapsed': 15638400, 'year': 1991, 'month': 7, 'day': 1, 'hour': 0, 'total_power': 2957.592219109529, 'total_power_no_units': -0.29575922191095294, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 9.949206675456736, 'action_': [18, 27]}\n", + "Reward: -7041.095957436299 {'timestep': 20352, 'time_elapsed': 18316800, 'year': 1991, 'month': 8, 'day': 1, 'hour': 0, 'total_power': 4484.510318043606, 'total_power_no_units': -0.44845103180436063, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 11.07359623673829, 'action_': [21, 24]}\n", + "Reward: -9296.59688572278 {'timestep': 23328, 'time_elapsed': 20995200, 'year': 1991, 'month': 9, 'day': 1, 'hour': 0, 'total_power': 4077.687654856706, 'total_power_no_units': -0.40776876548567065, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 11.79347434337422, 'action_': [22, 22]}\n", + "Reward: -10863.569765398093 {'timestep': 26208, 'time_elapsed': 23587200, 'year': 1991, 'month': 10, 'day': 1, 'hour': 0, 'total_power': 3962.959903637627, 'total_power_no_units': -0.39629599036376273, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 6.985007523418071, 'action_': [22, 22]}\n", + "Reward: -11617.7046973911 {'timestep': 29184, 'time_elapsed': 26265600, 'year': 1991, 'month': 11, 'day': 1, 'hour': 0, 'total_power': 3747.895494409444, 'total_power_no_units': -0.3747895494409444, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 4.43013838706209, 'action_': [18, 27]}\n", + "Reward: -12213.685087327127 {'timestep': 32064, 'time_elapsed': 28857600, 'year': 1991, 'month': 12, 'day': 1, 'hour': 0, 'total_power': 3962.959903637627, 'total_power_no_units': -0.39629599036376273, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': 4.866732045629226, 'action_': [22, 22]}\n", + "Reward: -12851.12643466358 {'timestep': 35040, 'time_elapsed': 31536000, 'year': 1992, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 6205.54217205275, 'total_power_no_units': -0.620554217205275, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [], 'out_temperature': -0.4835161520335998, 'action_': [21, 21]}\n", + "Episode 0 Mean reward: -0.36675589140025355 Cumulative reward: -12851.12643466358\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "[2022-08-24 08:56:26,964] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n" + "[2022-10-03 11:08:18,405] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 11:08:18,405] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 11:08:18,405] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 11:08:18,405] EPLUS_ENV_datacenter-cool-discrete-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n" ] } ], @@ -249,10 +290,8 @@ "]\n", "\n", "new_action_variables = [\n", - " 'West-HtgSetP-RL',\n", - " 'West-ClgSetP-RL',\n", - " 'East-HtgSetP-RL',\n", - " 'East-ClgSetP-RL'\n", + " 'Heating_Setpoint_RL',\n", + " 'Cooling_Setpoint_RL',\n", "]\n", "\n", "new_observation_space = gym.spaces.Box(\n", @@ -262,16 +301,16 @@ " dtype=np.float32)\n", "\n", "new_action_mapping = {\n", - " 0: (15, 30, 15, 30),\n", - " 1: (16, 29, 16, 29),\n", - " 2: (17, 28, 17, 28),\n", - " 3: (18, 27, 18, 27),\n", - " 4: (19, 26, 19, 26),\n", - " 5: (20, 25, 20, 25),\n", - " 6: (21, 24, 21, 24),\n", - " 7: (22, 23, 22, 23),\n", - " 8: (22, 22, 22, 22),\n", - " 9: (21, 21, 21, 21)\n", + " 0: (15, 30),\n", + " 1: (16, 29),\n", + " 2: (17, 28),\n", + " 3: (18, 27),\n", + " 4: (19, 26),\n", + " 5: (20, 25),\n", + " 6: (21, 24),\n", + " 7: (22, 23),\n", + " 8: (22, 22),\n", + " 9: (21, 21)\n", "}\n", "\n", "new_action_space = gym.spaces.Discrete(10)\n", @@ -313,7 +352,356 @@ "source": [ "In case the definition has some inconsistency, such as the *IDF* has not been \n", "adapted to the new actions, the spaces do not fit with the variables, the \n", - "observation variables do not exist, etc. Sinergym will display an error." + "observation variables do not exist, etc. *Sinergym* will display an error.\n", + "\n", + "**Action variables** defined must exists in IDF model like external interface.\n", + "Then, you have two possibilities: \n", + "\n", + "- First, you can modify IDF file directly, but it is necessary to update several \n", + " components depending in order to connect them to the external interface \n", + " (requires knowledge of the building and EnergyPlus).\n", + "- Second, you can use the **action definition** functionality of *Sinergym* (recommended).\n", + " This functionality will modify the IDF file before starting the simulation automatically \n", + " based on a simple definition of the components to be replaced by an external control.\n", + " See \"updating action definition\" example to learn how to use it.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Getting information about building model with Sinergym" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "Sinergym can get the schedulers information automatically, in a Python dictionary and/or exporting that information in a excel file.\n", + "This information lets you know what things can be controlled by an external interface in the building.\n", + "The way to do it is very simple, just load the environment and call a method:" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "pycharm": { + "is_executing": true, + "name": "#%%\n" + } + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2022-10-03 11:08:48,685] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:08:48,685] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:08:48,686] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:08:48,686] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:08:48,688] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:08:48,688] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:08:48,689] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:08:48,689] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:08:48,690] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:08:48,690] EPLUS_ENV_demo-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'activitysch': {'Type': 'any number'},\n", + " 'actschd': {'Object1': {'object_field_name': 'activity_level_schedule_name',\n", + " 'object_name': 'space1-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object2': {'object_field_name': 'activity_level_schedule_name',\n", + " 'object_name': 'space2-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object3': {'object_field_name': 'activity_level_schedule_name',\n", + " 'object_name': 'space3-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object4': {'object_field_name': 'activity_level_schedule_name',\n", + " 'object_name': 'space4-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object5': {'object_field_name': 'activity_level_schedule_name',\n", + " 'object_name': 'space5-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Type': 'any number'},\n", + " 'airvelocitysch': {'Object1': {'object_field_name': 'air_velocity_schedule_name',\n", + " 'object_name': 'space1-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object2': {'object_field_name': 'air_velocity_schedule_name',\n", + " 'object_name': 'space2-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object3': {'object_field_name': 'air_velocity_schedule_name',\n", + " 'object_name': 'space3-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object4': {'object_field_name': 'air_velocity_schedule_name',\n", + " 'object_name': 'space4-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object5': {'object_field_name': 'air_velocity_schedule_name',\n", + " 'object_name': 'space5-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Type': 'any number'},\n", + " 'basinheatersched': {'Object1': {'object_field_name': 'basin_heater_operating_schedule_name',\n", + " 'object_name': 'main cooling coil 1',\n", + " 'object_type': 'Coil:Cooling:DX:TwoSpeed'},\n", + " 'Type': 'on/off'},\n", + " 'clg-setp-sch': {'Object1': {'object_field_name': 'cooling_setpoint_temperature_schedule_name',\n", + " 'object_name': 'dualsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:DualSetpoint'},\n", + " 'Object2': {'object_field_name': 'setpoint_temperature_schedule_name',\n", + " 'object_name': 'coolingsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:SingleCooling'},\n", + " 'Type': 'temperature'},\n", + " 'clothingsch': {'Type': 'any number'},\n", + " 'coolingcoilavailsched': {'Object1': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'main cooling coil 1',\n", + " 'object_type': 'Coil:Cooling:DX:TwoSpeed'},\n", + " 'Object2': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'dx cooling coil system '\n", + " '1',\n", + " 'object_type': 'CoilSystem:Cooling:DX'},\n", + " 'Type': 'fraction'},\n", + " 'equip-1': {'Object1': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space1-1 eleceq 1',\n", + " 'object_type': 'ElectricEquipment'},\n", + " 'Object2': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space2-1 eleceq 1',\n", + " 'object_type': 'ElectricEquipment'},\n", + " 'Object3': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space3-1 eleceq 1',\n", + " 'object_type': 'ElectricEquipment'},\n", + " 'Object4': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space4-1 eleceq 1',\n", + " 'object_type': 'ElectricEquipment'},\n", + " 'Object5': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space5-1 eleceq 1',\n", + " 'object_type': 'ElectricEquipment'},\n", + " 'Type': 'fraction'},\n", + " 'fanavailsched': {'Object1': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'vav sys 1 avail',\n", + " 'object_type': 'AvailabilityManager:Scheduled'},\n", + " 'Object2': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'supply fan 1',\n", + " 'object_type': 'Fan:VariableVolume'},\n", + " 'Type': 'fraction'},\n", + " 'htg-setp-sch': {'Object1': {'object_field_name': 'heating_setpoint_temperature_schedule_name',\n", + " 'object_name': 'dualsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:DualSetpoint'},\n", + " 'Object2': {'object_field_name': 'setpoint_temperature_schedule_name',\n", + " 'object_name': 'heatingsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:SingleHeating'},\n", + " 'Type': 'temperature'},\n", + " 'infil-sch': {'Object1': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space1-1 infil 1',\n", + " 'object_type': 'ZoneInfiltration:DesignFlowRate'},\n", + " 'Object2': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space2-1 infil 1',\n", + " 'object_type': 'ZoneInfiltration:DesignFlowRate'},\n", + " 'Object3': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space3-1 infil 1',\n", + " 'object_type': 'ZoneInfiltration:DesignFlowRate'},\n", + " 'Object4': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space4-1 infil 1',\n", + " 'object_type': 'ZoneInfiltration:DesignFlowRate'},\n", + " 'Object5': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space5-1 infil 1',\n", + " 'object_type': 'ZoneInfiltration:DesignFlowRate'},\n", + " 'Type': 'fraction'},\n", + " 'lights-1': {'Object1': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space1-1 lights 1',\n", + " 'object_type': 'Lights'},\n", + " 'Object2': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space2-1 lights 1',\n", + " 'object_type': 'Lights'},\n", + " 'Object3': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space3-1 lights 1',\n", + " 'object_type': 'Lights'},\n", + " 'Object4': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space4-1 lights 1',\n", + " 'object_type': 'Lights'},\n", + " 'Object5': {'object_field_name': 'schedule_name',\n", + " 'object_name': 'space5-1 lights 1',\n", + " 'object_type': 'Lights'},\n", + " 'Type': 'fraction'},\n", + " 'min oa sched': {'Object1': {'object_field_name': 'minimum_outdoor_air_schedule_name',\n", + " 'object_name': 'oa controller 1',\n", + " 'object_type': 'Controller:OutdoorAir'},\n", + " 'Type': 'fraction'},\n", + " 'min oarequirements sched': {'Object1': {'object_field_name': 'outdoor_air_schedule_name',\n", + " 'object_name': 'zoneminoarequirements',\n", + " 'object_type': 'DesignSpecification:OutdoorAir'},\n", + " 'Type': 'any number'},\n", + " 'occupy-1': {'Object1': {'object_field_name': 'number_of_people_schedule_name',\n", + " 'object_name': 'space1-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object2': {'object_field_name': 'number_of_people_schedule_name',\n", + " 'object_name': 'space2-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object3': {'object_field_name': 'number_of_people_schedule_name',\n", + " 'object_name': 'space3-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object4': {'object_field_name': 'number_of_people_schedule_name',\n", + " 'object_name': 'space4-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object5': {'object_field_name': 'number_of_people_schedule_name',\n", + " 'object_name': 'space5-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Type': 'fraction'},\n", + " 'plenumclg-setp-sch': {'Object1': {'object_field_name': 'setpoint_temperature_schedule_name',\n", + " 'object_name': 'plenumcoolingsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:SingleCooling'},\n", + " 'Type': 'temperature'},\n", + " 'plenumhtg-setp-sch': {'Object1': {'object_field_name': 'setpoint_temperature_schedule_name',\n", + " 'object_name': 'plenumheatingsetpoint',\n", + " 'object_type': 'ThermostatSetpoint:SingleHeating'},\n", + " 'Type': 'temperature'},\n", + " 'reheatcoilavailsched': {'Object1': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space1-1 vav reheat',\n", + " 'object_type': 'AirTerminal:SingleDuct:VAV:Reheat'},\n", + " 'Object10': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space5-1 zone coil',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Object11': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'main heating coil 1',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Object2': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space2-1 vav reheat',\n", + " 'object_type': 'AirTerminal:SingleDuct:VAV:Reheat'},\n", + " 'Object3': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space3-1 vav reheat',\n", + " 'object_type': 'AirTerminal:SingleDuct:VAV:Reheat'},\n", + " 'Object4': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space4-1 vav reheat',\n", + " 'object_type': 'AirTerminal:SingleDuct:VAV:Reheat'},\n", + " 'Object5': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space5-1 vav reheat',\n", + " 'object_type': 'AirTerminal:SingleDuct:VAV:Reheat'},\n", + " 'Object6': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space1-1 zone coil',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Object7': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space2-1 zone coil',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Object8': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space3-1 zone coil',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Object9': {'object_field_name': 'availability_schedule_name',\n", + " 'object_name': 'space4-1 zone coil',\n", + " 'object_type': 'Coil:Heating:Electric'},\n", + " 'Type': 'fraction'},\n", + " 'seasonal reset supply air temp sch': {'Type': 'temperature'},\n", + " 'shadetranssch': {'Object1': {'object_field_name': 'transmittance_schedule_name',\n", + " 'object_name': 'main south overhang',\n", + " 'object_type': 'Shading:Zone:Detailed'},\n", + " 'Object2': {'object_field_name': 'transmittance_schedule_name',\n", + " 'object_name': 'south door overhang',\n", + " 'object_type': 'Shading:Zone:Detailed'},\n", + " 'Type': 'fraction'},\n", + " 'workeffsch': {'Object1': {'object_field_name': 'work_efficiency_schedule_name',\n", + " 'object_name': 'space1-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object2': {'object_field_name': 'work_efficiency_schedule_name',\n", + " 'object_name': 'space2-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object3': {'object_field_name': 'work_efficiency_schedule_name',\n", + " 'object_name': 'space3-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object4': {'object_field_name': 'work_efficiency_schedule_name',\n", + " 'object_name': 'space4-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Object5': {'object_field_name': 'work_efficiency_schedule_name',\n", + " 'object_name': 'space5-1 people 1',\n", + " 'object_type': 'People'},\n", + " 'Type': 'fraction'},\n", + " 'zone control type sched': {'Object1': {'object_field_name': 'control_type_schedule_name',\n", + " 'object_name': 'space1-1 control',\n", + " 'object_type': 'ZoneControl:Thermostat'},\n", + " 'Object2': {'object_field_name': 'control_type_schedule_name',\n", + " 'object_name': 'space2-1 control',\n", + " 'object_type': 'ZoneControl:Thermostat'},\n", + " 'Object3': {'object_field_name': 'control_type_schedule_name',\n", + " 'object_name': 'space3-1 control',\n", + " 'object_type': 'ZoneControl:Thermostat'},\n", + " 'Object4': {'object_field_name': 'control_type_schedule_name',\n", + " 'object_name': 'space4-1 control',\n", + " 'object_type': 'ZoneControl:Thermostat'},\n", + " 'Object5': {'object_field_name': 'control_type_schedule_name',\n", + " 'object_name': 'space5-1 control',\n", + " 'object_type': 'ZoneControl:Thermostat'},\n", + " 'Type': 'control type'}}\n" + ] + } + ], + "source": [ + "import gym\n", + "import sinergym\n", + "\n", + "from pprint import pprint\n", + "\n", + "env = gym.make('Eplus-demo-v1')\n", + "schedulers=env.get_schedulers()\n", + "pprint(schedulers)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "The way to export an excel file with such organized information is by specifying a path to the method:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "pycharm": { + "is_executing": true, + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "actuators=env.get_schedulers(path='./example.xlsx')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is possible to know the zones available in the environment too. You only have to do the next:" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['plenum-1', 'space1-1', 'space2-1', 'space3-1', 'space4-1', 'space5-1']\n" + ] + } + ], + "source": [ + "print(env.get_zones())" ] }, { @@ -327,49 +715,111 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "As we have explained in the previous example, one of the problems that can arise when \n", + "As we have explained in the action and observation space example, one of the problems that can arise when \n", "modifying the space of actions and observations is that the *IDF* is not adapted to the \n", "new space of actions established.\n", "\n", - "We may even want to modify the effects of actions on the building directly for some kind \n", - "of interest without being subject to a change of the action space. For example, we may \n", - "want to change the zones assigned to each thermostat or change their value at the start \n", - "of the simulation.\n", - "\n", "For this purpose, the *Sinergym* **action definition** is available. With a dictionary we can \n", - "build a definition of what we want to be controlled in the building and how to control \n", - "it using the action space of the environment:" + "build a definition of what scheduler we want to be replaced in the building by the external control.\n", + "\n", + "For this example, we are going to add lights control to the external interface for the agent.\n", + "Then, is not only necessary to update that **action definition**, the list of the action\n", + "variables and space is necessary to be updated too." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", + " logger.warn(\n", + "[2022-10-03 11:09:11,535] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:09:11,535] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:09:11,535] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:09:11,537] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:09:11,537] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:09:11,537] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:09:11,539] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:09:11,539] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:09:11,539] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "[2022-10-03 11:09:11,541] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", + " logger.warn(\n", + "[2022-10-03 11:09:11,543] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:09:11,543] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:09:11,543] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Creating new EnergyPlus simulation episode...\n", + "[2022-10-03 11:09:11,685] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-5Zone-cool-continuous-stochastic-v1-res3/Eplus-env-sub_run1\n", + "[2022-10-03 11:09:11,685] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-5Zone-cool-continuous-stochastic-v1-res3/Eplus-env-sub_run1\n", + "[2022-10-03 11:09:11,685] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus working directory is in /workspaces/sinergym/examples/Eplus-env-5Zone-cool-continuous-stochastic-v1-res3/Eplus-env-sub_run1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reward: -0.4534218472503313 {'timestep': 1, 'time_elapsed': 900, 'year': 1991, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 2877.012363757218, 'total_power_no_units': -0.2877012363757218, 'comfort_penalty': -0.6191424581249407, 'abs_comfort': 0.6191424581249407, 'temperatures': [19.38085754187506], 'out_temperature': 2.365503840332209, 'action_': [17.785645, 29.71652, 0.22971705]}\n", + "Reward: -1357.8271189188051 {'timestep': 2976, 'time_elapsed': 2678400, 'year': 1991, 'month': 2, 'day': 1, 'hour': 0, 'total_power': 11100.46077251977, 'total_power_no_units': -1.110046077251977, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.21328190545486], 'out_temperature': 8.522913717556069, 'action_': [22.275938, 25.327274, 0.4951168]}\n", + "Reward: -2677.3228805407884 {'timestep': 5664, 'time_elapsed': 5097600, 'year': 1991, 'month': 3, 'day': 1, 'hour': 0, 'total_power': 701.0042651760367, 'total_power_no_units': -0.07010042651760368, 'comfort_penalty': -0.9436218379550496, 'abs_comfort': 0.9436218379550496, 'temperatures': [19.05637816204495], 'out_temperature': 5.40854483151097, 'action_': [17.999592, 24.87681, 0.37235415]}\n", + "Reward: -3562.8096013573713 {'timestep': 8640, 'time_elapsed': 7776000, 'year': 1991, 'month': 4, 'day': 1, 'hour': 0, 'total_power': 3024.567675350499, 'total_power_no_units': -0.3024567675350499, 'comfort_penalty': -0.8064452618224003, 'abs_comfort': 0.8064452618224003, 'temperatures': [19.1935547381776], 'out_temperature': 3.431054112168333, 'action_': [17.694782, 24.154045, 0.0044727325]}\n", + "Reward: -4450.951932642561 {'timestep': 11520, 'time_elapsed': 10368000, 'year': 1991, 'month': 5, 'day': 1, 'hour': 0, 'total_power': 8207.782406117527, 'total_power_no_units': -0.8207782406117528, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [21.55825762211984], 'out_temperature': 9.197726971145151, 'action_': [21.769848, 26.523382, 0.999089]}\n", + "Reward: -5156.415876501385 {'timestep': 14496, 'time_elapsed': 13046400, 'year': 1991, 'month': 6, 'day': 1, 'hour': 0, 'total_power': 156.5268202959072, 'total_power_no_units': -0.015652682029590723, 'comfort_penalty': -2.0777900257891204, 'abs_comfort': 2.0777900257891204, 'temperatures': [20.92220997421088], 'out_temperature': 10.73331677835388, 'action_': [17.877337, 24.082777, 0.6383258]}\n", + "Reward: -6840.042123890393 {'timestep': 17376, 'time_elapsed': 15638400, 'year': 1991, 'month': 7, 'day': 1, 'hour': 0, 'total_power': 120.4056020773604, 'total_power_no_units': -0.01204056020773604, 'comfort_penalty': -1.9790344535710993, 'abs_comfort': 1.9790344535710993, 'temperatures': [21.0209655464289], 'out_temperature': 9.82478126302217, 'action_': [16.911224, 23.718214, 0.75081384]}\n", + "Reward: -8538.664312876315 {'timestep': 20352, 'time_elapsed': 18316800, 'year': 1991, 'month': 8, 'day': 1, 'hour': 0, 'total_power': 170.1233311699604, 'total_power_no_units': -0.017012333116996042, 'comfort_penalty': -2.59502313830032, 'abs_comfort': 2.59502313830032, 'temperatures': [20.40497686169968], 'out_temperature': 10.4490846080284, 'action_': [16.818777, 23.734867, 0.241808]}\n", + "Reward: -10273.83205152557 {'timestep': 23328, 'time_elapsed': 20995200, 'year': 1991, 'month': 9, 'day': 1, 'hour': 0, 'total_power': 120.4056020773604, 'total_power_no_units': -0.01204056020773604, 'comfort_penalty': -1.768018008172639, 'abs_comfort': 1.768018008172639, 'temperatures': [21.23198199182736], 'out_temperature': 12.96124535280048, 'action_': [19.102827, 28.182596, 0.08341339]}\n", + "Reward: -12224.318447785688 {'timestep': 26208, 'time_elapsed': 23587200, 'year': 1991, 'month': 10, 'day': 1, 'hour': 0, 'total_power': 469.4587430154137, 'total_power_no_units': -0.046945874301541374, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.06553825688241], 'out_temperature': 6.844933137569515, 'action_': [15.480132, 23.393116, 0.51604635]}\n", + "Reward: -13041.260744220324 {'timestep': 29184, 'time_elapsed': 26265600, 'year': 1991, 'month': 11, 'day': 1, 'hour': 0, 'total_power': 658.9345665037555, 'total_power_no_units': -0.06589345665037555, 'comfort_penalty': -0.9947529958024113, 'abs_comfort': 0.9947529958024113, 'temperatures': [19.00524700419759], 'out_temperature': 6.139674604783751, 'action_': [15.60221, 23.140676, 0.7023196]}\n", + "Reward: -14028.556676010696 {'timestep': 32064, 'time_elapsed': 28857600, 'year': 1991, 'month': 12, 'day': 1, 'hour': 0, 'total_power': 140.0534103456761, 'total_power_no_units': -0.01400534103456761, 'comfort_penalty': -0.0, 'abs_comfort': 0.0, 'temperatures': [20.12511560374498], 'out_temperature': 5.961020408807885, 'action_': [15.309132, 28.84229, 0.020878673]}\n", + "Reward: -15380.029536325419 {'timestep': 35040, 'time_elapsed': 31536000, 'year': 1992, 'month': 1, 'day': 1, 'hour': 0, 'total_power': 10410.81751368661, 'total_power_no_units': -1.041081751368661, 'comfort_penalty': -0.4320504567081187, 'abs_comfort': 0.4320504567081187, 'temperatures': [19.56794954329188], 'out_temperature': -0.7071846842980632, 'action_': [19.668835, 28.38713, 0.0763033]}\n", + "Episode 0 Mean reward: -0.4389277835709471 Cumulative reward: -15380.029536325419\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2022-10-03 11:09:23,032] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 11:09:23,032] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n", + "[2022-10-03 11:09:23,032] EPLUS_ENV_5Zone-cool-continuous-stochastic-v1_MainThread_ROOT INFO:EnergyPlus simulation closed successfully. \n" + ] + } + ], "source": [ "import gym\n", "import numpy as np\n", "\n", + "new_action_variables=[\n", + "'Heating_Setpoint_RL',\n", + "'Cooling_Setpoint_RL',\n", + "'light_control'\n", + "]\n", + "\n", + "new_action_space=gym.spaces.Box(\n", + " low=np.array([15.0, 22.5, 0.0]),\n", + " high=np.array([22.5, 30.0, 1.0]),\n", + " shape=(3,),\n", + " dtype=np.float32\n", + ")\n", + "\n", "new_action_definition={\n", - " 'ThermostatSetpoint:DualSetpoint': [{\n", - " 'name': 'West-DualSetP-RL',\n", - " 'heating_name': 'West-HtgSetP-RL',\n", - " 'cooling_name': 'West-ClgSetP-RL',\n", - " 'heating_initial_value':21.0,\n", - " 'cooling_initial_value':25.0,\n", - " 'zones': ['West Zone']\n", - " },\n", - " {\n", - " 'name': 'East-DualSetP-RL',\n", - " 'heating_name': 'East-HtgSetP-RL',\n", - " 'cooling_name': 'East-ClgSetP-RL',\n", - " 'heating_initial_value':21.0,\n", - " 'cooling_initial_value':25.0,\n", - " 'zones': ['East Zone']\n", - " }]\n", + " 'Htg-SetP-Sch': {'name': 'Heating_Setpoint_RL', 'initial_value': 21},\n", + " 'Clg-SetP-Sch': {'name': 'Cooling_Setpoint_RL', 'initial_value': 25},\n", + " 'LIGHTS-1':{'name':'light_control','initial_value':0.2}\n", + "\n", "}\n", "\n", - "env = gym.make('Eplus-datacenter-cool-continuous-stochastic-v1', \n", + "env = gym.make('Eplus-5Zone-cool-continuous-stochastic-v1',\n", + " action_variables=new_action_variables,\n", + " action_space=new_action_space,\n", " action_definition=new_action_definition\n", " )\n", "\n", @@ -399,10 +849,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The name of the heating and cooling should be the name of action variables defined in the environment. \n", - "Otherwise, *Sinergym* will show the inconsistency.\n", - "\n", - "For more information about the format of the action definition dictionaries, visit the section called [action definition](https://ugr-sail.github.io/sinergym/compilation/html/pages/environments.html#action-definition)." + "Previously, it is recommended to know what controllers are available in the specific building model, see the previous example of this notebook. For more information about the format of the action definition dictionaries, visit the section called [action definition](https://ugr-sail.github.io/sinergym/compilation/html/pages/environments.html#action-definition)." ] }, { @@ -423,9 +870,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2022-10-03 11:10:20,132] EPLUS_ENV_datacenter-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf ExternalInterface object if it is not present...\n", + "[2022-10-03 11:10:20,133] EPLUS_ENV_datacenter-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf Site:Location and SizingPeriod:DesignDay(s) to weather and ddy file...\n", + "[2022-10-03 11:10:20,136] EPLUS_ENV_datacenter-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Updating idf OutPut:Variable and variables XML tree model for BVCTB connection.\n", + "[2022-10-03 11:10:20,141] EPLUS_ENV_datacenter-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up extra configuration in building model if exists...\n", + "[2022-10-03 11:10:20,143] EPLUS_ENV_datacenter-cool-continuous-stochastic-v1_MainThread_ROOT INFO:Setting up action definition in building model if exists...\n", + "/usr/local/lib/python3.10/dist-packages/gym/spaces/box.py:73: UserWarning: \u001b[33mWARN: Box bound precision lowered by casting to float32\u001b[0m\n", + " logger.warn(\n" + ] + } + ], "source": [ "extra_conf={\n", " 'timesteps_per_hour':6,\n", diff --git a/docs/compilation/doctrees/pages/environments.doctree b/docs/compilation/doctrees/pages/environments.doctree index 58f234c002..1dff7fd2e6 100644 Binary files a/docs/compilation/doctrees/pages/environments.doctree and b/docs/compilation/doctrees/pages/environments.doctree differ diff --git a/docs/compilation/doctrees/pages/introduction.doctree b/docs/compilation/doctrees/pages/introduction.doctree index b61e2110d8..07b5fa4a6f 100644 Binary files a/docs/compilation/doctrees/pages/introduction.doctree and b/docs/compilation/doctrees/pages/introduction.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.envs.doctree b/docs/compilation/doctrees/pages/modules/sinergym.envs.doctree index 7a88947a29..662162d0ad 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.envs.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.envs.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.EplusEnv.doctree b/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.EplusEnv.doctree index fa4ba088c9..524a55d754 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.EplusEnv.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.EplusEnv.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.doctree b/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.doctree index 984e5c71ac..b65d3f277f 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.envs.eplus_env.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.BaseSimulator.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.BaseSimulator.doctree index 6b7584c4e2..13156c7ed0 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.BaseSimulator.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.BaseSimulator.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.doctree index 15b7025607..5196f2c97a 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.base.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.doctree index 7afea1d33d..05d2d121f4 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.EnergyPlus.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.EnergyPlus.doctree index 84ec7dfba6..48f53c4a16 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.EnergyPlus.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.EnergyPlus.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.doctree index aebb1fdd3a..b6aad36421 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.EnergyPlus.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.EnergyPlus.doctree index aed94e279d..39b0e16e4e 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.EnergyPlus.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.EnergyPlus.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.doctree b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.doctree index d09c30b1d0..9b7eb9d864 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.simulators.eplus_alpha.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerCallback.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerCallback.doctree index 24411de7d3..d2b07a41ce 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerCallback.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerCallback.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerEvalCallback.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerEvalCallback.doctree index 01aa415fbe..7055869bb1 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerEvalCallback.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.LoggerEvalCallback.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.doctree index 5f98199022..677664d125 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.callbacks.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.create_variable_weather.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.create_variable_weather.doctree index 70d3d24bdc..b11ea4d744 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.create_variable_weather.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.create_variable_weather.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.doctree index 91206c3bdd..660f3bd3f6 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.export_actuators_to_excel.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.export_actuators_to_excel.doctree index 169893abdc..4aeafa44a5 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.export_actuators_to_excel.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.export_actuators_to_excel.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_current_time_info.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_current_time_info.doctree index d3824282ec..e802db7df0 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_current_time_info.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_current_time_info.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_delta_seconds.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_delta_seconds.doctree index 751dc08013..d4feb48b8f 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_delta_seconds.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_delta_seconds.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_record_keys.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_record_keys.doctree index eb097c37d4..8be1ce4dfe 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_record_keys.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_record_keys.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_season_comfort_range.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_season_comfort_range.doctree index aa04179dd6..d5c786ace8 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_season_comfort_range.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.get_season_comfort_range.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.is_wrapped.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.is_wrapped.doctree index af84646fa5..cad4a3245b 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.is_wrapped.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.is_wrapped.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.parse_variables.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.parse_variables.doctree index 2da5e11c32..300a7b9191 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.parse_variables.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.parse_variables.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.prepare_batch_from_records.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.prepare_batch_from_records.doctree index 512f28d8ed..211a462147 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.prepare_batch_from_records.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.prepare_batch_from_records.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.ranges_getter.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.ranges_getter.doctree index bdd19e903d..db1ee3b436 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.ranges_getter.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.ranges_getter.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.to_idf.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.to_idf.doctree index 80d6dcaba4..e99da1a5b1 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.to_idf.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.to_idf.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.unwrap_wrapper.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.unwrap_wrapper.doctree index 2fee009810..162bb202e8 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.common.unwrap_wrapper.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.common.unwrap_wrapper.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.config.Config.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.config.Config.doctree index 6eb98e80d3..d11f697903 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.config.Config.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.config.Config.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.config.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.config.doctree index ceef2e8548..ee538b722a 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.config.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.config.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.constants.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.constants.doctree index 98f71ffc11..f5c7572a1e 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.constants.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.constants.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBC5Zone.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBC5Zone.doctree index fffd6dd128..27eeb8d9a4 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBC5Zone.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBC5Zone.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBCDatacenter.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBCDatacenter.doctree index 436b8f84ad..58d79180fb 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBCDatacenter.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RBCDatacenter.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RandomController.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RandomController.doctree index 55ff735637..460390010e 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RandomController.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.RandomController.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.doctree index 82ddc899b3..c91ead8ec9 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.controllers.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.doctree index d883a25604..984b41819d 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.check_env.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.check_env.doctree index b71e0f3bcc..ef52f8172c 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.check_env.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.check_env.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.doctree index 389a6a9fa5..d068daee8f 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.env_checker.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.doctree index 13589aba65..8b30946e88 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.evaluate_policy.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.evaluate_policy.doctree index a5b460a7e7..47393696dc 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.evaluate_policy.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.evaluation.evaluate_policy.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.delete_instance_MIG_from_container.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.delete_instance_MIG_from_container.doctree index 10bf1877f6..03aacbe5bc 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.delete_instance_MIG_from_container.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.delete_instance_MIG_from_container.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.doctree index 73cb57a57b..be585c3de7 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.get_service_account_token.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.get_service_account_token.doctree index 018d28c986..3a41a8abe0 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.get_service_account_token.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.get_service_account_token.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.init_storage_client.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.init_storage_client.doctree index 6fe175333b..aefb0dea1a 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.init_storage_client.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.init_storage_client.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.read_from_bucket.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.read_from_bucket.doctree index 258a4c235e..c9f02a7cbd 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.read_from_bucket.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.read_from_bucket.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.upload_to_bucket.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.upload_to_bucket.doctree index c2c5624133..82416e1324 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.upload_to_bucket.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.gcloud.upload_to_bucket.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.CSVLogger.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.CSVLogger.doctree index d78b327816..7771c37f7e 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.CSVLogger.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.CSVLogger.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.Logger.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.Logger.doctree index 0a266cc64b..9721533e9d 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.Logger.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.Logger.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.doctree index b0c036c2a1..cf8ba9ff9c 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.logger.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.BaseReward.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.BaseReward.doctree index 3e300db140..d5862a4c01 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.BaseReward.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.BaseReward.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.ExpReward.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.ExpReward.doctree index f4939df945..4487883283 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.ExpReward.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.ExpReward.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.HourlyLinearReward.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.HourlyLinearReward.doctree index b7851de666..709e436f55 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.HourlyLinearReward.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.HourlyLinearReward.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.LinearReward.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.LinearReward.doctree index 696e5d57f9..35eea91cd1 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.LinearReward.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.LinearReward.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.doctree index cf770161f8..ff039d9b0b 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.rewards.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.LoggerWrapper.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.LoggerWrapper.doctree index dd8c49cac3..cb63b59a54 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.LoggerWrapper.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.LoggerWrapper.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.MultiObsWrapper.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.MultiObsWrapper.doctree index 7af7626dae..4ee8d8f1b6 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.MultiObsWrapper.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.MultiObsWrapper.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.NormalizeObservation.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.NormalizeObservation.doctree index e97fc66e47..b0a5fa9c75 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.NormalizeObservation.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.NormalizeObservation.doctree differ diff --git a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.doctree b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.doctree index e2c931959f..fb076ea6ba 100644 Binary files a/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.doctree and b/docs/compilation/doctrees/pages/modules/sinergym.utils.wrappers.doctree differ diff --git a/docs/compilation/doctrees/pages/notebooks/basic_example.doctree b/docs/compilation/doctrees/pages/notebooks/basic_example.doctree index a993fce20c..80a2a8ab68 100644 Binary files a/docs/compilation/doctrees/pages/notebooks/basic_example.doctree and b/docs/compilation/doctrees/pages/notebooks/basic_example.doctree differ diff --git a/docs/compilation/doctrees/pages/notebooks/change_environment.doctree b/docs/compilation/doctrees/pages/notebooks/change_environment.doctree index 1283545bc5..6a1fd53467 100644 Binary files a/docs/compilation/doctrees/pages/notebooks/change_environment.doctree and b/docs/compilation/doctrees/pages/notebooks/change_environment.doctree differ diff --git a/docs/compilation/html/_sources/index.rst.txt b/docs/compilation/html/_sources/index.rst.txt index 316de1bf03..d9eaf1da15 100644 --- a/docs/compilation/html/_sources/index.rst.txt +++ b/docs/compilation/html/_sources/index.rst.txt @@ -72,7 +72,6 @@ If you use Sinergym in your work, please cite our `paper :[,, ...], - : ... + :'name':{,'initial_value':}, + ... } -The ```` will depend on the specific type of controller that we are -going to create, we have the next support: +For an example about how to use this action definition functionality, +visit section :ref:`Adding a new action definition`. -~~~~~~~~~~~~~~~~~~~~~~~~ -Thermostat:DualSetpoint -~~~~~~~~~~~~~~~~~~~~~~~~ +Sinergym obtains a list of the schedulers available in the building model that is loaded in that +environment and is stored as an environment attribute. The information that appears in this dictionary has the following structure: -This controller has the next values in its definition: - -- *name*: DualSetpoint resource name (str). - -- *heating_name*: Heating setpoint name. This name should be an action variable defined - in your environment (str). - -- *cooling_name*: Cooling setpoint name. This name should be an action variable defined - in your environment (str). - -- *heating_initial_value*: Initial value the heating thermostat initialize the simulation with (float). - -- *cooling_initial_value*: Initial value the cooling thermostat initialize the simulation with (float). - -- *zones*: An thermostat can manage several building zones at the same time. Then, you - can specify one or more zones (List(str)). If the zone name specified is not - exist in building, Sinergym will report the error. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -ThermostatSetpoint:SingleHeating -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This controller has the next values in its definition: - -- *name*: SingleHeating Setpoint resource name (str). - -- *heating_name*: Heating setpoint name. This name should be an action variable defined - in your environment (str). - -- *heating_initial_value*: Initial value the heating thermostat initialize the simulation with. - -- *zones*: An thermostat can manage several building zones at the same time. Then, you - can specify one or more zones (List(str)). If the zone name specified is not - exist in building, Sinergym will report the error. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -ThermostatSetpoint:SingleCooling -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This controller has the next values in its definition: - -- *name*: SingleCooling Setpoint resource name (str). +.. code:: python -- *cooling_name*: Cooling setpoint name. This name should be an action variable defined - in your environment (str). + # env.schedulers + { + :{'Type':, + 'Object1':{'':,'':,'':}, + 'Object2':{'':,'':,'':}, + ... + }, + ... + } -- *cooling_initial_value*: Initial value the cooling thermostat initialize the simulation with. +For each scheduler found, a new entry is created in the dictionary in which the **key** is its +name, the data **type** and **objects** in which the value of the scheduler is used are included. +Sinergym will use this information to perform the automatic changes you want in the action definition +we have seen above. -- *zones*: An thermostat can manage several building zones at the same time. Then, you - can specify one or more zones (List(str)). If the zone name specified is not - exist in building, Sinergym will report the error. +Sinergym replaces the original scheduler with an external interface created and used in each of the +objects it handled. The data type does not need to be specified, since Sinergym uses the data type +of the replaced scheduler. -For an example about how to use it, see :ref:`Adding a new action definition`. +This allows any component to be handled by an external interface with a simple definition by the user. +Although it is first necessary to know the components that are included in the building. -.. note:: If you want to create your own controller type compatibilities, - please see the method ``adapt_idf_to_action_definition`` from - `Config class `__. +If you do not want to read directly the dictionary of ``env.schedulers``, it is also possible to export +a pdf with such information in a better presented form to study those things that you want to manage. +For an example about how to use it, see :ref:`Getting information about building model with Sinergym`. Extra configuration =================== @@ -416,7 +385,7 @@ The main steps you have to follow are the next: available in the simulation before starting. In order to be able to do these checks, you need to copy **RDD file** with the same name than *IDF* file (except extension) to `variables `__. - To obtain this **RDD file** you have to run a simulation with *Energyplus* directly + To obtain this **RDD file**, you have to run a simulation with *Energyplus* directly and extract from output folder. Make sure that **Output:VariableDictionary** object in *IDF* has the value *Regular* in order to *RDD* file has the correct format for *Sinergym*. diff --git a/docs/compilation/html/_sources/pages/introduction.rst.txt b/docs/compilation/html/_sources/pages/introduction.rst.txt index 78b97cb35b..1e178c6288 100644 --- a/docs/compilation/html/_sources/pages/introduction.rst.txt +++ b/docs/compilation/html/_sources/pages/introduction.rst.txt @@ -51,16 +51,12 @@ The main functionalities of *Sinergym* are the following: In short, *Sinergym* automates the whole process of model adaptation so that the user only has to define what he wants for his environment. -- **Automatic external interface integration for actions**. As far as building model (*IDF*) adaptation - is concerned, it is not enough to set up an external interface and set user-specified - variable names. It is also necessary to make certain adjustments to the building components to be - controlled, so that they use the external variables defined by the user instead of the default - controllers implicitly provided by the building model. To do this, *Sinergym* provides a functionality - that can adapt actuators to the desired building zones by providing a specification by the user. - The building model will be manipulated based on this information automatically. In other words, - if the components to be controlled are directly supported by *Sinergym*, the building model can be modified - accordingly to be controlled, otherwise the user will have to modify the *IDF* file manually. More actuator - types will be directly supported by *Sinergym* in the future. +- **Automatic external interface integration for actions**. Sinergym provides functionality to obtain information + about the environments such as the zones or the schedulers available in the environment model. Using that information, + which is possible to export in a excel, users can know which controllers are available in the building and, then, control + them with an external interface from an agent. To do this, users will make an **action definition** in which it is + indicated which default controllers they want to replace in a specific format and *Sinergym* will take care of the relevant internal + changes in the model. - **Stable Baseline 3 Integration**. Some functionalities like callbacks have been customized by our team in order to test easily these environments @@ -82,6 +78,9 @@ The main functionalities of *Sinergym* are the following: the users in order to help them become familiar with the tool. They are constantly updated, along with the updates and improvements of the tool itself. +- This project is accompanied by extensive **documentation**, **unit tests** and **github actions workflows** to make + *Sinergym* an efficient ecosystem for both understanding and development. + - Many more! .. note:: *This is a work in progress project. Stay tuned for upcoming releases!* diff --git a/docs/compilation/html/_sources/pages/modules/sinergym.envs.eplus_env.EplusEnv.rst.txt b/docs/compilation/html/_sources/pages/modules/sinergym.envs.eplus_env.EplusEnv.rst.txt index db07195bc7..a83779c2c0 100644 --- a/docs/compilation/html/_sources/pages/modules/sinergym.envs.eplus_env.EplusEnv.rst.txt +++ b/docs/compilation/html/_sources/pages/modules/sinergym.envs.eplus_env.EplusEnv.rst.txt @@ -17,7 +17,8 @@ ~EplusEnv.__init__ ~EplusEnv.close - ~EplusEnv.get_actuators + ~EplusEnv.get_schedulers + ~EplusEnv.get_zones ~EplusEnv.render ~EplusEnv.reset ~EplusEnv.seed diff --git a/docs/compilation/html/_sources/pages/modules/sinergym.utils.config.Config.rst.txt b/docs/compilation/html/_sources/pages/modules/sinergym.utils.config.Config.rst.txt index 42463eb48e..1aaeb7ce1b 100644 --- a/docs/compilation/html/_sources/pages/modules/sinergym.utils.config.Config.rst.txt +++ b/docs/compilation/html/_sources/pages/modules/sinergym.utils.config.Config.rst.txt @@ -21,6 +21,7 @@ ~Config.adapt_variables_to_cfg_and_idf ~Config.apply_extra_conf ~Config.apply_weather_variability + ~Config.get_schedulers ~Config.save_building_model ~Config.save_variables_cfg ~Config.set_episode_working_dir diff --git a/docs/compilation/html/genindex.html b/docs/compilation/html/genindex.html index 5338b17493..257efb0a0b 100644 --- a/docs/compilation/html/genindex.html +++ b/docs/compilation/html/genindex.html @@ -63,7 +63,6 @@