A win-win algorithm for aggregated residential energy management: resource optimisation and user acceptance learning