Optimisation of Batchwise Dyeing Processes