  We consider piecewise-deterministic optimal control problems in which the
environment randomly switches among several deterministic modes, and the goal
is to optimize the expected cost up to the termination while taking the
likelihood of future mode-switches into account. The dynamic programming
approach yields a weakly-coupled system of Hamilton-Jacobi-Bellman PDEs
satisfied by the value functions of individual modes. We derive and implement
semi-Lagrangian and Eulerian numerical schemes for that system. We further
recover simpler, "asymptotically optimal" controls and test their performance
in non-asymptotic regimes. Our approach is illustrated on a simple anisotropic
path-planning problem: the time-optimal control for a boat affected by randomly
switching winds.
