Simulation of Manufacturing Processes Subject to Maintenance Actions and Quality Control