A systematic approach of integrated building control for optimization of energy and cost