MEC and IoT based automatic agent reconfiguration in industry 4.0