Add Cost.is_stochastic to make warning more selective