Adapted to the changes of the project EnergyAgents.