  We develop a model for the long-term dynamics of electricity market, based on
mean-field games of optimal stopping. Our paper extends the recent contribution
[A\"id, Ren\'e, Roxana Dumitrescu, and Peter Tankov, ``The entry and exit game
in the electricity markets: A mean-field game approach." Journal of Dynamics \&
Games 8.4 (2021): 331] in several ways, making the model much more realistic,
especially for describing the medium-term impacts of energy transition on
electricity markets. In particular, we allow for an arbitrary number of
technologies with endogenous fuel prices and enable the agents to both invest
and divest. This makes it possible to describe the role of gas generation as a
medium-term substitute for coal, to be replaced by renewable generation in the
long term, and enables us to model the events like the 2022 energy price
crisis.
