Constrained energy optimization in heterogeneous platforms using generalized scaling models