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

Adding new models #6

Open
LorenzoBottaccioli opened this issue Aug 27, 2022 · 1 comment
Open

Adding new models #6

LorenzoBottaccioli opened this issue Aug 27, 2022 · 1 comment

Comments

@LorenzoBottaccioli
Copy link

Dear,

Thanks for your great work. I'm trying to add new models to the environment but after compiling the FMU it is unclear how to use it. By reading a little bit of the code of the existing ones I have understood that I have to create a enviromnet.py script but is completely unclear how to and in particular how to add it to the factory.py script that is the one in charge of doing the make command. Could you provide some guidelines for it or a tutorial?

Thanks a lot

@psh987
Copy link
Collaborator

psh987 commented Aug 30, 2022

Dear Lorenzo, thanks for your interest in Energym! It's a good idea to provide a full tutorial, we will do that, but it might take a while. In the meantime, here are the most important steps:

  1. add your model in the simulation folder in the appropriate category (EnergyPlus or Modelica)
  2. create a folder in energym.envs with the name of your model with an init.py and environment.py in it.
  3. in the environment.py, you have to specify the inputs and outputs as dictionaries, in the INPUTS_SPECS and OUTPUTS_SPECS, and the default kpi options (also as dictionary)
  4. To create a class for your model, either subclass EnvEPlusFMU (if your model is EnergyPlus based) or EnvModFMU (if your model is Modelica based)
  5. Specify fixed attributes of your model (like simulation step size) in the class and pass the flexible attributes (like the simulation start time) in the init.
  6. add the name of your model to the EnvNames enum in env_names.py
  7. import your class in factory.py
  8. in the make function, filter for the name you specified in EnvNames and create one instantiation for the case of the evaluation mode (everything should be fixed there), and one for the normal mode (considering passed keyword arguments in make)

I hope the steps make sense, and I think it is helpful to pick one of the available models to compare how the steps are done there. If you have any questions, feel free to reach out anytime!

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

2 participants