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