Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
asrjy opened this issue May 19, 2023 · 8 comments
Open

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

asrjy opened this issue May 19, 2023 · 8 comments

Comments

@asrjy
Copy link

asrjy commented May 19, 2023

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
Copy link

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

@asrjy
Copy link
Author

asrjy commented Jun 5, 2023

@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
Copy link

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
Copy link
Author

asrjy commented Jul 4, 2023

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

@yasamin62
Copy link

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
Copy link
Author

asrjy commented Jul 4, 2023

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
Copy link

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
Copy link

yasamin62 commented Jul 4, 2023

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants