Create an algorithm which maximizes products per cycle without dying. You can use operator and the calculateProduction/Consumption functions.