  Algorithms and models based on game theory have nowadays become prominent
techniques for the design of digital controllers for critical systems. Indeed,
such techniques enable automatic synthesis: given a model of the environment
and a property that the controller must enforce, those techniques automatically
produce a correct controller, when it exists. In the present paper, we consider
a class of concurrent, weighted, multi-player games that are well-suited to
model and study the interactions of several agents who are competing for some
measurable resources like energy. We prove that a subclass of those games
always admit a Nash equilibrium, i.e. a situation in which all players play in
such a way that they have no incentive to deviate. Moreover, the strategies
yielding those Nash equilibria have a special structure: when one of the agents
deviate from the equilibrium, all the others form a coalition that will enforce
a retaliation mechanism that punishes the deviant agent. We apply those results
to a real-life case study in which several smart houses that produce their own
energy with solar panels, and can share this energy among them in micro-grid,
must distribute the use of this energy along the day in order to avoid
consuming electricity that must be bought from the global grid. We demonstrate
that our theory allows one to synthesise an efficient controller for these
houses: using penalties to be paid in the utility bill as an incentive, we
force the houses to follow a pre-computed schedule that maximises the
proportion of the locally produced energy that is consumed.
