Heuristic intelligent method for machine maintenance and process optimization