integration of cost model with sd algo