Hacker News new | ask | show | jobs
by syntheweave 1204 days ago
In implementing an AI to achieve orbit in a Spacewar-style simulation with gravity, I ended up with a brute-force constraint optimizer that resembles MCP(I've never studied the theory): for each timestep, predict the solutions resulting for each combination of digital thrust inputs(left, right, forward, backwards). Then predict ahead several more steps with additional permutations of input. Then evaluate distance to goal and rank final solution by distance to target orbit and velocity match.

In doing this, it results in a few hundreds to thousands of solutions to test per timestep, which modern CPUs can shrug off easily. Not nearly as elegant as closed-form control theory systems, but easy to tune and give different goals.

1 comments

replace the brute-force with a linear constraint solver, and you got yourself an MPC !

non-linear constraint solvers are not used because they cannot guarantee a time to solution, hence useless for control applications