  The lifelong control problem of an off-grid microgrid is composed of two
tasks, namely estimation of the condition of the microgrid devices and
operational planning accounting for the uncertainties by forecasting the future
consumption and the renewable production. The main challenge for the effective
control arises from the various changes that take place over time. In this
paper, we present an open-source reinforcement framework for the modeling of an
off-grid microgrid for rural electrification. The lifelong control problem of
an isolated microgrid is formulated as a Markov Decision Process (MDP). We
categorize the set of changes that can occur in progressive and abrupt changes.
We propose a novel model based reinforcement learning algorithm that is able to
address both types of changes. In particular the proposed algorithm
demonstrates generalisation properties, transfer capabilities and better
robustness in case of fast-changing system dynamics. The proposed algorithm is
compared against a rule-based policy and a model predictive controller with
look-ahead. The results show that the trained agent is able to outperform both
benchmarks in the lifelong setting where the system dynamics are changing over
time.
