Optimization of extraction and treatment plant solutions taking account of raw material variability