Stochasticity Incompatible with Optimization

I have been thinking about the design of a framework capable of modelling an entire cell. Two of the design specifications, stochasticity and optimization, that I have been planning to incorporate seem to be incompatible.