upb-lea / openmodelica-microgrid-gym

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

Monte-Carlo-based simulation #68

Closed Webbah closed 4 years ago

Webbah commented 4 years ago

To represent real world more accurately, define parameters as distribution (gaussian, normal).

Parameters:

(Implementation will be done in #59 )

wallscheid commented 4 years ago

Variant: Compare mean or min (worst-case) over the sampled performances to robustify the SafeOpt pipeline.

Webbah commented 4 years ago

_nMC: number of Monte-Carlo samples as input to runner

runner

Env: Every n_MC simulation: new parameters are drawn

Agent: only has to update after n_MC simulations Every n_MC simulation: new performance is calculated After n_MC -> average performance used for optimization to find next controller parameters

Webbah commented 4 years ago

Changed env.reset() to initialize model parameters with different values using model_param : https://github.com/upb-lea/openmodelica-microgrid-gym/blob/c845d1a7769c67ba203bbfeeaa510a09e4cde95d/openmodelica_microgrid_gym/env/modelica.py#L263

Even solves the problem that the first parameter value (before the first step) is correct and avoids loadsteps in the beginning.

@stheid better possibility or other suggestion? Or where else are the initial parameters (from python) set yet?


Problem with additional loadstep?

stheid commented 4 years ago

I mean, OpenModelicaParameters can be functions of any type, so this is not an issue from an implementation state. But you also mean to addidionally parametrize the rest of the environment, right?

Webbah commented 4 years ago

First Additionally: Abstract agent class EpisodicLearnerAgent(Agent) -> safeotp inherits from EpisodicLearnerAgent and staticctrlAgent

Execution:

agent.observe always call with done = false -> update_params NEVER called! After n_MC runs of n_MC loop agent.performance = mean(episodic_Performance) Call agent.update_params explicitly

-> so present agent and env don't have to be modified

Webbah commented 4 years ago

Problem with additional Load class in main script:

@stheid ideas for structure?

Webbah commented 4 years ago
Webbah commented 4 years ago

Implemented in #59