A multi-agent system approach to exploit demand-side flexibility in an energy community