Algorithms for Self-Optimising Chemical Platforms