In this paper, a collective residential building is considered in which the following points are taken into consideration: (i) flexibility value of Contract Power (CP) for each consumer; (ii) it assumed single CP entire building; (iii) an energy resource manager entity to manage resources building, such as Electric Vehicles (EVs), Photovoltaic (PV) generation system, and Battery Energy Storage ...