Probabilistic design of switched systems