upb-lea / openmodelica-microgrid-gym

OpenModelica Microgrid Gym (OMG): An OpenAI Gym Environment for Microgrids
GNU General Public License v3.0
182 stars 37 forks source link

Provide modelparams in Load/Filter component that set device values #130

Open Webbah opened 3 years ago

Webbah commented 3 years ago

https://github.com/upb-lea/openmodelica-microgrid-gym/blob/8073a3380766462fd8132844e0628ea238bdaa5a/openmodelica_microgrid_gym/net/components.py#L179

Possible to shift all device parameters to net.yaml?

Till now: L,C,R... parameters are defined in file and given to model_params in env maks/register.

Idea: Use net.yaml as bundeld config with all(!!) (initial) env-parameters.

modelparams = {r_load.resistor1.R: net['l_load'].R} still needed or solved internally?

How to implement loadsteps in that case?

modelparams = {r_load.resistor1.R: partial(rand_load.load_step, gain=net['l_load'].R)}?

Webbah commented 3 years ago

https://github.com/upb-lea/openmodelica-microgrid-gym/blob/8073a3380766462fd8132844e0628ea238bdaa5a/openmodelica_microgrid_gym/env/modelica.py#L309

shift params from {values,...} to {...,self.net.params(delayed_action)}

TAKE CARE: What if from net and model_params have the same key:

env.make( model_params={'r_load.resistor1.R': 10} )

and in net -> Load(Component-class): 'r_load.resistor1.R': 20

is r_load.resistor1.R 10 or 20?

toDo: Check in modelica.py 309 (link above) which overwrites what

Webbah commented 3 years ago

Here: https://github.com/upb-lea/openmodelica-microgrid-gym/blob/8073a3380766462fd8132844e0628ea238bdaa5a/openmodelica_microgrid_gym/net/components.py#L179

use coponent.id('r_load') + '.' name from net ('resistor1.R : 10') instead if model_params (see above)