Text this: Optimal Control Of A Stochastic Hybrid System