Digital twin of production and factory optimization