Energy efficient algorithm for the calculation of the demand of accommodation in the artificial accommodation system