Planning, optimization and controlling of the production