bsl546 / energym

Energym is an open source building simulation library designed to test climate control and energy management strategies on buildings in a systematic and reproducible way.
Other
63 stars 11 forks source link

2022.12.26 erro #8

Closed rainbownmm closed 1 year ago

rainbownmm commented 1 year ago

Starting Simulation at 01/01/2017 for ALL_YEAR ExternalInterface starts first data exchange. Error: Unspecified error when reading from socket. *FATAL:Error in ExternalInterface: Check EnergyPlus .err file.

rainbownmm commented 1 year ago

Hello, everyone. I don't know what caused this. I installed it according to the tutorial. Can anyone help me? Thank you very much

rainbownmm commented 1 year ago

Did not find file "socket.cfg".

psh987 commented 1 year ago

Can you check what is logged in the .err file? It should be in the corresponding subfolder of the Energym_runs folder in your user directory. Also, what system are you using, and which commands lead to the error? You could try running one of the Modelica-based models and see if that works without an error.

rainbownmm commented 1 year ago

Thanks for your reply. His error file is like this, showing Socket communication received error value "- 1" at time=5.00E-002 hours, I use the Windows system. I try to run it with the idf file in energyplus, and he prompts me to Did not find file "socket. cfg". Is this related to BCVTB? I hope you can help me

rainbownmm commented 1 year ago

energyplus erro 70094d1f23d7c63c3b55c5c544c523c

rainbownmm commented 1 year ago

.err file df9982778f693c941b5daf8ac23ce57

rainbownmm commented 1 year ago

I ran the example in python as follows import energym

envName = "Apartments2Grid-v0" nsteps = 10 env = energym.make(envName, simulation_days=100)

The last sentence reports an error. The saved information is shown in the error file above

psh987 commented 1 year ago

I'm not sure what the issue is, EnergyPlus is on your PATH, right? It's hard to find the reason for this problem, on my side your example is running fine.

rainbownmm commented 1 year ago

Thank you. Yes, I make sure its path is in my environment variable, and energyplus is version 9.5.0

rainbownmm commented 1 year ago

I experimented on two computers, win10 and win11, but both failed. They were the same error

rainbownmm commented 1 year ago

1672219762063 I use the Modelica-based models to directly report an error. The information is as follows

psh987 commented 1 year ago

That doesn't seem like an error to me, but the standard output after initializing the model. Are you also performing simulation steps, or are you just initializing the model?

rainbownmm commented 1 year ago

Thanks, this is just a problem in initializing Modelica based models. Why does the initialization of energyplus model cause such errors? It seems that it has started to simulate

psh987 commented 1 year ago

Again, the output for the Modelica based model seems normal if you just initialize the model and don't run any simulation steps. Also, I'm a bit confused about the output format of the initialization (I think the top picture is actually from .err file and the other one is from the initialization, right?), are you executing your code with some command line, like the Anaconda Prompt?

psh987 commented 1 year ago

No, wait, since both of your pictures are referencing the .err file, is it actually the content of the .err file?

rainbownmm commented 1 year ago

I did not use Anaconda Prompt. First, I installed energyplus and configured the environment. After creating a new conda environment and installing energy through "python setup. py install -- verbose", I reported an error when running the following statement


import energym

envName = "Apartments2Grid-v0"

env = energym.make(envName)


In the output folder "Output_EPExport_instance1672228400", the error statement in the error file in the folder is shown in this picture

rainbownmm commented 1 year ago

1672228575993 In this file ”Apartments2_heavy_insulated.err“

psh987 commented 1 year ago

I can't reproduce the error on my side. I will check with my colleagues if they have an idea what could be going wrong, but this will need a bit of time.

I guess it doesn't make a difference if you add the following to your statement, right? env.step(inputs={}) env.close()

This would be to make sure that the error is not due to ending the simulation before sending any input and closing it properly.

rainbownmm commented 1 year ago

Well, thank you very much. After I added these two sentences, it seems that he doesn't report errors in energyplus, but lacks batch files

”找不着批处理文件“

It means "batch file not found"

rainbownmm commented 1 year ago

1672238844155

psh987 commented 1 year ago

That should not be an issue, it seems to work fine then. For your simulations, you then need to pass the proper inputs, and you can observe the measurements which are returned from the env.step() method.

rainbownmm commented 1 year ago

Thanks for your answer. It seems that the problem is solved by adding close(). Thank you very much

rainbownmm commented 1 year ago

Hello, can you give me some more examples about controlling energym through RL? I tried some, but the result is not good. There will be some mistakes. If you can, thank you very much

psh987 commented 1 year ago

You can have a look at this issue and the corresponding branch, maybe that helps. I would close this issue, since the original problem has been solved, but you can open a new one if you encounter other problems