Optimal cycle production of a manufacturing system subject to deterioration