zhangzhizza / Gym-Eplus

GNU General Public License v3.0
59 stars 26 forks source link

How can I add support for newer EnergyPlus version? #6

Open asrjy opened 1 year ago

asrjy commented 1 year ago

I have some IDF files that I want to use with this, but they are created using E+ 22.1. Since there's no way to downgrade the IDF files, how can I make this work with those files? I've tried using the latest E+ folder with the script but it didn't work.

KostadinovicNikola commented 1 year ago

@asrjy Have you tested with the code they provided ? for version 8.6.0 ? Idk why i have an error with it.

asrjy commented 1 year ago

@KostadinovicNikola I have tested it with 8.6.0, and it works fine. I'm having some issues with my IDF file so I'm unable to test it with 22.

To make it work for 22, you need to make a few changes to the get_run_info function in the eplus_86.py file.

yasamin62 commented 1 year ago

I have some IDF files that I want to use with this, but they are created using E+ 22.1. Since there's no way to downgrade the IDF files, how can I make this work with those files? I've tried using the latest E+ folder with the script but it didn't work.

Hi

I have installed successfully the eplus-env-0.0.1. In fact, I have done the following lines in the Windows command prompt:

cd C:\0-Yasamin...\Gym-Eplus-master git clone https://github.com/zhangzhizza/Gym-Eplus.git cd Gym-Eplus

python -m venv .env .env\Scripts\activate

pip install gym pip install -e .

then I typed "python" in cmd and continue with:

import gym import eplus_env; env = gym.make('Eplus-demo-v1');

but when I used the example and type the " env = gym.make('Eplus-demo-v1');" in the Windows command prompt, it gives this error.

env = gym.make('Eplus-demo-v1') Traceback (most recent call last): File "", line 1, in File "C:\0-Yasamin...\Gym-Eplus-master\Gym-Eplus.env\lib\site-packages\gym\envs\registration.py", line 669, in make env = PassiveEnvChecker(env) File "C:\0-Yasamin...\Gym-Eplus-master\Gym-Eplus.env\lib\site-packages\gym\wrappers\env_checker.py", line 20, in init assert hasattr( AssertionError: The environment must specify an action space. https://www.gymlibrary.dev/content/environment_creation/

I am a beginner with python and OpenAI gym, Could you please guide me to correct it? Thanks

asrjy commented 1 year ago

Can you check the version of gym you're using? Downgrading to 0.19 usually fixes this.

yasamin62 commented 1 year ago

Thanks, it worked! But now it gives another error:

import gym import eplus_env; env = gym.make('Eplus-demo-v1'); curSimTime, ob, isTerminal = env.reset(); # Reset the env (creat the EnergyPlus subprocess) [2023-07-04 08:08:23,800] EPLUS_ENV_Eplus-demo-v1_MainThread_ROOT INFO:Creating EnergyPlus simulation environment... [2023-07-04 08:08:23,809] EPLUS_ENV_Eplus-demo-v1_MainThread_ROOT INFO:EnergyPlus working directory is in C:\0-Yasamin\Knowledge Base\Python\Gym-Eplus-master\Gym-Eplus\Eplus-env-Eplus-demo-v1-res19\Eplus-env-sub_run1 Traceback (most recent call last): File "", line 1, in File "C:\0-Yasamin\Knowledge Base\Python\Gym-Eplus-master\Gym-Eplus\eplus_env\envs\eplus8_6.py", line 146, in reset eplus_process = self._create_eplus(self._eplus_path, self._weather_path, File "C:\0-Yasamin\Knowledge Base\Python\Gym-Eplus-master\Gym-Eplus\eplus_env\envs\eplus8_6.py", line 279, in _create_eplus preexec_fn=os.setsid); AttributeError: module 'os' has no attribute 'setsid'

asrjy commented 1 year ago

You need to make some changes because you are running it in Windows.

Something like this https://stackoverflow.com/questions/47016723/windows-equivalent-for-spawning-and-killing-separate-process-group-in-python-3

yasamin62 commented 1 year ago

You need to make some changes because you are running it in Windows.

Something like this https://stackoverflow.com/questions/47016723/windows-equivalent-for-spawning-and-killing-separate-process-group-in-python-3

Thank you very much for your help. As I said I'm a beginner in Python, But I try the solution. I hope to succeed in solving this error. I give you feedback.

yasamin62 commented 1 year ago

@asrjy If I want to switch to Linux, I must download Ubuntu 16.04 or I can use the other versions of Linux for example 18.04.06? Can I use Ubuntu terminal environment in Windows? (I mean Windows Subsystem for Linux)