A Digital Twin Framework for Predictive Maintenance in Industry 4.0