Sustainable life cycle and energy management of discrete manufacturing plants in the industry 4.0 framework