Energy allocation and payment: a game-theoretic approach