Stabilization and reference tracking for constrained switching systems: a predictive control approach