I'm new to optimal control and exercising with some toy examples. However, I cannot easily solve systems where the feasible action space is a function of the current state.
Suppose we have the following system $$ \max J = \int_0^T u(t) \ dt $$ subject to $$ x(0) = x_0,\\ \dot x(t) = f(u(t)),\\ u(t) \in \Omega(x(t)) := \begin{cases} [0,1] &\mbox{if } x(t) < \theta,\\ {0} &\mbox{otherwise,} \end{cases} $$ where $f$ is some nice nonnegative increasing function. We can rewrite this to an optimal stopping problem that stops at time $\tau$, i.e., we add the terminal condition $x(\tau) = \theta$ and the state constraint $x(t) < \theta$ for $t < \tau$. Is this the way to go or is there a better way to solve such a system?