Green Production Planning and Control for the Textile Industry by Using Mathematical Programming and Industry 4.0 Techniques

The textile industry is one of the world’s major sources of industrial pollution, and related environmental issues are becoming an ever greater concern. This paper considers the environmental issues of carbon emissions, energy recycling, and waste reuse, and uses a mathematical programming model with Activity-Based Costing (ABC) and the Theory of Constraints (TOC) to achieve profit maximization. This paper discusses the combination of mathematical programming and Industry 4.0 techniques to achieve the purpose of green production planning and control for the textile industry in the new era. The mathematical programming model is used to determine the optimal product mix under various production constraints, while Industry 4.0 techniques are used to control the production progress to achieve the planning targets. With the help of an Industry 4.0 real-time sensor and detection system, it can achieve the purposes of recycling waste, reducing carbon emission, saving energy and cost, and finally achieving a maximization of profit. The main contributions of this research are using mathematical programming approach to formulate the decision model with ABC cost data and TOC constraints for the textile companies and clarifying the relation between mathematical programming models and Industry 4.0 techniques. Managers in the textile companies can apply this decision model to achieve the optimal product-mix under various constraints and to evaluate the effect on profit of carbon emissions, energy recycling, waste reuse, and material quantity discount. Record Type: Published Article Submitted To: LAPSE (Living Archive for Process Systems Engineering) Citation (overall record, always the latest version): LAPSE:2018.0594 Citation (this specific file, latest version): LAPSE:2018.0594-1 Citation (this specific file, this version): LAPSE:2018.0594-1v1 DOI of Published Version: https://doi.org/10.3390/en11082072 License: Creative Commons Attribution 4.0 International (CC BY 4.0) Powered by TCPDF (www.tcpdf.org)


Introduction
The traditional textile industry has always been labor-intensive and highly polluting [1]. In the past, the textile industry production process was very complicated. Many detailed actions needed to be executed; this caused a production trend of large volume but less variety [2]. Now people are paying more attention to product quality and unique requirements due to technology and people's living habits change. As a result, the manufacturing industry has moved toward customized production [3,4]. Technology has also been strengthened in response to such changes. Recently, many manufactures have been influenced by Industry 4.0. They are not only optimizing the manufacturing processes, but also effectively controlling industrial pollution with the assistance of data maintenance and monitoring [5,6].
The Industry 4.0 smart manufacturing concept was first presented at the Hanover Fair (Germany) in 2011, where it received great attention from different industry sectors in various nations [7,8]. Some researchers claim that the main essentials of Industry 4.0 are the integration of system components and the digitalization of manufacturing/service operations [9,10]. However, most companies in the

Brief of Industry 4.0
From the eighteenth century up to today, there have been four industrial revolutions. The first industrial revolution started with the invention of the steam engine and led to a manual-production industry. The second included the use of electrical energy and assembly lines for mass production. The third was marked by the emergence of the computer, IT systems and automation. The fourth industrial revolution is called Industry 4.0; it combines the new technologies of Cyber-Physical Systems (CPS), Internet of Things (IoT), big data and cloud computing to enhance production efficiency [35,36]. Industry 4.0 is a new developmental stage rather than an extension of the third industrial revolution. It is especially suited to mass customization production. By means of CPS and IOT, machines can communicate with each other and send data in real time to systems and people [37,38].
Manufacturing operations have been transformed from traditional production into intelligent production. Industry 4.0 faces increased competitiveness and more complex challenges in dealing with the status of demographic changes, production processes, resources and the environment [39,40]. Hence, Industry 4.0 will solve problems with the use of CPS and IoT. Enterprises need vertical integration by the use of networks. CPS can connect resources and products through large data analysis and intelligent sensing technology to automate the monitoring of plant inventory, demand and equipment failure, and is well suited for maintenance management. At the same time, all the processing stages of the production process are recorded, including product variability, order modification, quality instability or machine failure, and other factors. As a result, material wear can be more effectively controlled, and waste in the production process will be reduced, thus increasing efficiency. However, enterprises also need horizontal integration of the production process, from purchasing, production and even sales, or from suppliers to the company, and finally to the customer. It is not only applicable to the production stage, but also extends to commodity development, subscriptions, plans, assembly and distribution, to ensure quality, time control, risk, price and environmental protection; in so doing, other factors in the entire value chain of each link are immediately controlled [5,38,41].
For the textile industry, Küsters et al. claimed that there are the following Industry 4.0 applications: (1) Status monitoring for real-time process parameters; (2) Product shadow for tracking the product production cycle; (3) Digital assistant system for instructing operators; (4) Digital performance management for problem solving by providing the digital Key Performance Indicator (KPI) board; (5) Automated Guided Vehicles (AGV) for material handling; (6) YET for analyzing Yield, Energy, and Throughput; (7) iCycle time for real-time line balancing; (8) Real-time WIP for real-time tracking of the Work-In-Process; (9) Predictive maintenance for breakdown prevention by the analysis of Big Data; (10) Smart routing and work station setup for self-adjusting work stations; (11) In-line Quality Control (QC) and adaptive machining by using the parameter or image analysis of Big Data; (12) Human-machine collaboration; (13) 3D printing for tailored production components; and so on [9].

The Influence of Industry 4.0 and Green Production on the Textile Industry
The textile industry is one of the major sources of environmental pollution in the industrial world [42]. The main environmental problems are those attributable to carbon emissions and the discharge of untreated wastewater. Recently, there has been an increased awareness of the need for environmental protection and green production. It is therefore obligatory that the textile production process must conform to the required standards of emissions.
The textile industry's Industry 4.0 requires the digital factory. Its core technology is Cyber-Physical Systems (CPS). This is the real equipment's computer software mapping. Every step of the production process is compiled in the virtual world to establish a high simulation of digitalism in the virtual and real worlds; this process will be simulated and optimized on the materials, products and factories in the real physical world. Next, the Internet of Things (IoT) is used to gather information by sensor, Programmable Logic Controller (PLC), visual equipment, etc., to transfer information through the Internet to accomplish Human-Computer Interaction (HCT) [43][44][45]. Then, using the Internet to  transmit information, people or machines can be operate based on the data collected for analysis and  decision-making, with objects controlled by connection to the Internet for the implementation of the  tasks and decision-making; objects connected with the Internet can even communicate and cooperate with each other directly.
The textile industry is a labor-intensive industry, and its complex manufacturing processes and long supply chain characteristics mean that large variety and small volume customized production requires an "intelligent" factory [46,47]. Industry 4.0, as it relates to the textile industry, has three characteristics: production network, Cyber-Physical Systems (CPS) and Internet of Things (IoT). In the smart factory, CPS is the real equipment's software mapping in the computer. Every step of the production process may be compiled in the virtual world to establish high level digital simulation of in the virtual and real world. The process will simulate and optimize the materials, products and factories of the real physical world. Manufacture execution systems (MES) will manage the master data, situation and maintenance records of equipment, like helping suppliers in the production value chain obtain and exchange real-time production information, and ensure that all of the components supplied by the supplier will arrive at the right time in the right order [48,49]. Industry 4.0 is more than machine automation; it involves the whole production process. First, there is real-time monitoring, digitizing and the setting up of the cyber-physical systems for the plant's machinery. The manufacturer sets the sensors on the machines and concatenates all of them via a network to continuously collect production data and send the data to the enterprise resource planning system (ERP) [50][51][52][53][54]. Then there is the gathering and organizing of data to be sent to the cloud platform to analyze the big data [37,55]. Cloud platforms serve just like human vertebra; they are vertical integrations of systems from upstream to downstream. According to customer demand, material supply may be changed via machine-to-machine conversation and real-time status monitoring [55][56][57]. In the past, production was limited by the extant technology. Since different lengths of cloth consume almost the same amount of dye and water, the product yield is less and the cost is higher. While it was very difficult to achieve large variety and small volume manufacturing, the smart factory solves the problem of the cost of customized production, matching the cost of mass production [58].

A Production Process for a Typical Textile Company
The traditional textile industry is a labor-intensive. Every process needs a lot of workers to complete the product [46,47]. The product is a result of yarn spinning, weaving, dyeing and finishing. There are three main processes involved in fabric production as shown in Figure 1. The first step is yarn production made from fibers by drawing and twisting bobbins together and then spinning it to turn in into yarn. The next step is the weaving. The weaving machine requires two sets of the yarn: warp and weft set, and the two sets of yarn are then joined together by weaving. The fabric made from the looms without any further processing is called greige fabric. Next, the fresh greige fabric is stained, but as it still contains impurities, it must be washed. The fabric is then dyed in a high temperature, high pressure dyeing machine. Finally, the fabric is given a special tactile impression and function, like smooth, suede, waterproof, wrinkle-free, non-felting, flame retardant, etc. Currently, as a result of the development of science and technology, enterprises can vertically integrate all aspects of the textile industry, so that the quantity and quality can be self-controlled.
In addition, dyeing machines require high heat, often produced by coal in the dyeing and finishing process, but burning coal is harmful to the environment, A plant will mix the waste cinder with cement to produce the light texture and good permeability of ecological bricks (eco-brick). The production of eco-bricks is not only beneficial to the environment, but also saves costs by avoiding the expenses incurred by shipping out the cinders.

Assumptions
To develop vertical integration following the Industry 4.0 decision model and without loss of generality (WLOG), this paper discuss the classic textile production process in the following. One unit material processed in the process of twisting will produce e1 units of draw textured yarn and (1 − e1) units of scrap include false yarn. Drawn textured yarn can not only be sold, but may be further processed; scrap yarn will be sold at a lower price. After further processing by weaving, it will produce e2 units of greige fabric and (1 − e2) units of scrap fabric. Greige fabric can be sold or further processed. The final process is that of dyeing and finishing, and then the finished fabric is produced.
Except for assumptions of the production process, the green production of the Industry 4.0 decision model purposed has the following assumptions. First, the activities are categorized as unitlevel and batch-level; resource drivers and activity drivers connect with ABC and Theory of Constraints (TOC) [23][24][25]. Second, the model does not involve capacity expansion and outsourcing of resources and materials, such as machine hours. Third, the labor working hours can be enhanced through overtime work with higher wage rates conforming to government regulations. Fourth, when the material quantity exceeds the threshold quantities, the purchaser obtains a piecewise price discount for all material resources. Fifth, the cost of CO2 emissions is dependent on emission quantities that are taxed at different rates as a piecewise variable cost. Sixth, water and heat resulting from energy recycling save costs. Seventh, fixed costs include machine costs, depreciation and other required production costs.

Objective Function
The objective function of the green production planning model under ABC and Industry 4.0 is as follows:

Assumptions
To develop vertical integration following the Industry 4.0 decision model and without loss of generality (WLOG), this paper discuss the classic textile production process in the following. One unit material processed in the process of twisting will produce e 1 units of draw textured yarn and (1 − e 1 ) units of scrap include false yarn. Drawn textured yarn can not only be sold, but may be further processed; scrap yarn will be sold at a lower price. After further processing by weaving, it will produce e 2 units of greige fabric and (1 − e 2 ) units of scrap fabric. Greige fabric can be sold or further processed. The final process is that of dyeing and finishing, and then the finished fabric is produced.
Except for assumptions of the production process, the green production of the Industry 4.0 decision model purposed has the following assumptions. First, the activities are categorized as unit-level and batch-level; resource drivers and activity drivers connect with ABC and Theory of Constraints (TOC) [23][24][25]. Second, the model does not involve capacity expansion and outsourcing of resources and materials, such as machine hours. Third, the labor working hours can be enhanced through overtime work with higher wage rates conforming to government regulations. Fourth, when the material quantity exceeds the threshold quantities, the purchaser obtains a piecewise price discount for all material resources. Fifth, the cost of CO 2 emissions is dependent on emission quantities that are taxed at different rates as a piecewise variable cost. Sixth, water and heat resulting from energy recycling save costs. Seventh, fixed costs include machine costs, depreciation and other required production costs.

Objective Function
The objective function of the green production planning model under ABC and Industry 4.0 is as follows: Maximize π = Total Revenue of main product + Revenue of by product − Total material cost − Total direct labor cost − Carbon tax − Energy recycling cost saving − Total other fixed cost The unit selling price of i product X 11 The selling quantities of drawn textured yarn X 12 The future processing quantities of drawn textured yarn X 21 The selling quantities of greige fabric X 22 The selling quantities of finished fabric β i The unit selling price of i by-product e 1 The input-output coefficient from POY to drawn textured yarn and scrap yarn e 2 The input-output coefficient from textured yarn to greige fabric and scrap fabric e 3 The input-output coefficient of Eco-Brick C 1 , C 2 , C 3 , C 4 The unit material cost of M, m 22d , m 22c and m 22m C 5 , C 6 The unit recycle saving cost of heat and water M The material quantities of POY m 22d The material quantities of dye m 22c The material quantities of cinder m 22m The material quantities of cement L 0 The direct labor cost of available normal hours η 0 , η 1 Special ordered sets of type 1 (SOS1) of 0/1 variables, where only one variable will be 1 r ot The wage rate of the total direct labor hours in overtime work situations Q 1 The overtime working hours (extend working hours to 2 hours per worker) G 0 The limit of the normal direct labor hour δ 0 , δ 1 , δ 2 Special ordered sets of type 1 (SOS1) of 0/1 variables, where only one variable will be 1 r c1 The carbon tax rate of available normal CO 2 emission quantities r c2 The carbon tax rate that produces excessive CO 2 emission quantities TC 1 The total CO 2 emission quantities in normal production TC 2 The total CO 2 emission quantities that produces excessive CO 2 emission quantities GC 0 No charge for CO 2 emission quantities RE h , RE w Green energy recycling saving quantities of heat and water F Fixed cost

Unit-Level Direct Labor Cost Function
Assume that overtime work can expand the direct labor resources, and labor is used for handling the material and products. The total cost function of direct labor is the piecewise linear function, as shown in Figure 2. The available normal direct labor hours are G 0 and the direct labor hours can be expanded to G 1 with the total direct labor cost respectively being L 0 and L 0 +m 1 G 1 at G 0 and G 1 . As well as the handling and setup, direct labor is also needed to transfer the products to the next plant. The setup of direct labor hours incudes the time required to replace material or reset programs during each batch start in the dyeing process, like the setup of dyestuff. The total direct labor cost is L 0 +η 1 r ot (Q 1 −G 0 ) in Equation (1), and the associated constraints are shown in Equations (2)-(5): l 1 M + l 2 X 12 +l 3 X 22 +µ 01 B 01 +µ 12 B 12 +µ 10 B 10 +µ 23 B 23 +µ 20 B 20 +µ 30 B 30 where: The direct labor hours required by M l 2 The direct labor hours required by X 12 l 3 The direct labor hours required by X 22 µ s,e The direct labor hours of the handling of each batch-level activity from start to finish B s,e The product of shipping from start to finish in terms of quantities needed at each batch-level ω Each batch of direct labor hours of setup BS The setup product in terms of quantities of each batch-level Q 0 The total direct labor hours in the normal working hour Q 1 The overtime working hours (extend working hours to 2 h per worker) G 0 The limit of the normal direct labor hour G 1 The limit of the overtime work direct labor hour η 0 , η 1 Special ordered sets of type 1 (SOS1) of 0/1 variables. where: The direct labor hours required by M l 2 The direct labor hours required by X l 3 The direct labor hours required by X µ s,e The direct labor hours of the handling of each batch-level activity from start to finish B s,e The product of shipping from start to finish in terms of quantities needed at each batch-level ω Each batch of direct labor hours of setup BS The setup product in terms of quantities of each batch-level Q 0 The total direct labor hours in the normal working hour Q 1 The overtime working hours (extend working hours to 2 h per worker) G0 The limit of the normal direct labor hour G1 The limit of the overtime work direct labor hour η 0 , η 1 Special ordered sets of type 1 (SOS1) of 0/1 variables.

Batch-Level Activity Cost Function for Material Handling and Setup Activities
Batch-level activity in the production includes material and products handling from the start to finish; when the goods are finished, they will be shipped back to the plant awaiting sale. The other activity is the material dyestuff setup: where σ s,e The quantity of handling of each batch-level activity from start to finish λ The quantity of setup of batch-level activity Quantity Cost L0+rotG1 L0 G0 G1

Batch-Level Activity Cost Function for Material Handling and Setup Activities
Batch-level activity in the production includes material and products handling from the start to finish; when the goods are finished, they will be shipped back to the plant awaiting sale. The other activity is the material dyestuff setup: where σ s,e The quantity of handling of each batch-level activity from start to finish λ The quantity of setup of batch-level activity

Carbon Tax Function
Global warming is an important issue. Reducing the greenhouse effect is a primary concern, and one of the main factors affecting the greenhouse effect is that of carbon dioxide emissions [1,[59][60][61]. The textile industry is the one of the major industries guilty of excessive CO 2 emissions in global manufacturing, especially in the dyeing and finishing process [62][63][64]. Assume that CO 2 emissions are taxed at different rates as a piecewise variable cost as shown in Figure 3. When CO 2 emissions are well controlled according to particular criteria, there is free carbon tax in TC 0 . The standard of the CO 2 emissions is TC 1 , and the tax will be higher than the standard when CO 2 emissions exceed GC 1 and become TC 2 . The total carbon tax cost is δ 1 r c1 (TC 1 −GC 0 )+δ 2 r c2 (TC 2 −GC 0 ) as shown in Equation (1), and the associated constraints are Equations (13)-(17): where: q c The total CO 2 emission quantities in the dyeing and finishing process TC 0 The total CO 2 emission quantities where there is no charge in standard range TC 1 The total CO 2 emission quantities in normal production TC 2 The total CO 2 emission quantities that produces excessive CO 2 emission quantities GC 0 No charge for CO 2 emission quantities GC 1 Carbon tax cost of normal capacity GC 2 Carbon tax cost for over emission capacity δ 0 , δ 1 , δ 2 Special ordered sets of type 1 (SOS1). The summation of 0/1 variables is 1

Carbon Tax Function
Global warming is an important issue. Reducing the greenhouse effect is a primary concern, and one of the main factors affecting the greenhouse effect is that of carbon dioxide emissions [1,[59][60][61]. The textile industry is the one of the major industries guilty of excessive CO2 emissions in global manufacturing, especially in the dyeing and finishing process [62][63][64]. Assume that CO2 emissions are taxed at different rates as a piecewise variable cost as shown in Figure 3. When CO2 emissions are well controlled according to particular criteria, there is free carbon tax in TC 0 . The standard of the CO2 emissions is TC 1 , and the tax will be higher than the standard when CO2 emissions exceed GC1 and become TC 2 . The total carbon tax cost is δ 1 r c1 TC 1 -GC 0 )+δ 2 r c2 TC 2 -GC 0 ) as shown in Equation (1), and the associated constraints are Equations (13)-(17): where: q c The total CO2 emission quantities in the dyeing and finishing process TC 0 The total CO2 emission quantities where there is no charge in standard range TC 1 The total CO2 emission quantities in normal production TC 2 The total CO2 emission quantities that produces excessive CO2 emission quantities GC 0 No charge for CO2 emission quantities GC 1 Carbon tax cost of normal capacity GC 2 Carbon tax cost for over emission capacity δ 0 , δ 1 , δ 2 Special ordered sets of type 1 (SOS1). The summation of 0/1 variables is 1

Energy Recycling
The textile industry, during the dyeing and finishing processes, needs to generate a lot of heat. It generally uses heat from burning coal, steam boilers, and medium heat boilers and heating furnaces. The use of its high temperature and air heat transfer can enhance the combustion air temperature, and reduce the exhaust temperature to achieve waste heat recovery purposes [65,66]. However, the textile industry is also a heavy consumer of water [42]. It is therefore evident that water recycling and reuse is also an important wastewater treatment issue [67]. Heat and water are used mainly in the dyeing and finishing process [68]; thus, energy recycling of heat and water will vary with the production quantity of the finished fabric. The energy recycling cost saving for heat and GC1 GC0

Energy Recycling
The textile industry, during the dyeing and finishing processes, needs to generate a lot of heat. It generally uses heat from burning coal, steam boilers, and medium heat boilers and heating furnaces. The use of its high temperature and air heat transfer can enhance the combustion air temperature, and reduce the exhaust temperature to achieve waste heat recovery purposes [65,66]. However, the textile industry is also a heavy consumer of water [42]. It is therefore evident that water recycling and reuse is also an important wastewater treatment issue [67]. Heat and water are used mainly in the dyeing and finishing process [68]; thus, energy recycling of heat and water will vary with the production quantity of the finished fabric. The energy recycling cost saving for heat and water are C 5 RE h and C 6 RE w , respectively, in Equation (1), and the associated constraints are Equations (18) and (19): where: The relation coefficient between energy recycling of heat and X 22 ρ 2 The relation coefficient between energy recycling of water and X 22

Input-Output Relationship
The amount of material input and product output differs because the material suffers loss in the production process, such as in the weaving process. Fabric is made of yarn, and some scrap from the fabric articles will remain that is the input-output coefficient. X 12 is the quantity of yarn, e 2 X 12 is the quantity of fabric and (1 − e 2 )X 12 is the quantity of scrap fabric, as below: where BP i The quantities of i byproduct ϑ 1 The relation coefficient between m 22d and X 22 ϑ 2 The relation coefficient between m 22c and X 22 ϑ 3 The relation coefficient between m cin and X 22 ϑ 4 The relation coefficient between m cem and X 22 Textile manufacturing process with the symbols of quantity variables mentioned in Equations (20)-(32) is shown as Figure 4.

Other Sale and Production Constraints
There are three kinds of machines to generate products. A twisting machine is used to false twist the yarn, a loom is used to weave the fabric, and a dyeing and finishing machine is used to dye the fabric and give the fabric other special qualities. Those are limiting machines in so far as their efficiency is limited by the material, operator, and machine maintenance time [69]. Therefore, producing a product requires limited machine hours, including twisting machine hours (h 1 ), weaving machine hours (h 2 ) and dyeing and finishing machine hours (h 22 ), as expressed in the following Equations (23)-(25): Machine hour constraints:

Other Sale and Production Constraints
There are three kinds of machines to generate products. A twisting machine is used to false twist the yarn, a loom is used to weave the fabric, and a dyeing and finishing machine is used to dye the fabric and give the fabric other special qualities. Those are limiting machines in so far as their efficiency is limited by the material, operator, and machine maintenance time [69]. Therefore, producing a product requires limited machine hours, including twisting machine hours (h 1 ), weaving machine hours (h 2 ) and dyeing and finishing machine hours (h 22 ), as expressed in the following Equations (23)-(25): Machine hour constraints: where: h 1 the resources of machine hours of false twisting h 2 the resources of machine hours of weaving h 22 the resources of machine hours of dyeing and finishing H 1 The limited machine hours of false twisting H 2 The limited machine hours of weaving H 22 The limited machine hours of dyeing and finishing

Illustrative Data and Optimal Decision Analysis
The model assumes that the textile factory is a vertically integrated plant that uses one material to produce three different products, which are similar to the joint-product model. After the production of false twist yarns with a raw yarn, part of the drawn textured yarn is sold while the rest continues to be processed into greige fabric. Part of the embryo fabric is sold, the rest undergoes dyeing and finishing procedures, and finally a high price finished fabric is produced. The associated costs in this model include: (1) Unit-level activity: material costs and director labor cost, (2) Batch-level activity: material and product handling and setup of the dyeing process, (3) environment-level activity: carbon tax and energy recycling cost, (4) Fixed cost: To more effectively trace and identify cost in the production, our model considers related production costs which include depreciation, land, plant and equipment as fixed cost to accurately evaluate production. This model can also be used to help corporations find the optimal solution to effectively decrease production cost by means of an optimal product portfolio and resource allocation.
The production data for production planning model for the production process of Figure 1 are presented in Tables 1 and 2. In this model, assume that there are three products and three by-products that can be sold: draw textured yarn (X 11 ), greige fabric (X 21 ), finished fabric (X 22 ), scrap yarn (β 1 ), scrap fabric (β 2 ) and eco-brick (β 3 ). The unit prices of products are 97,000, 135,000, 202,500, 570, 2100 and 2300 NTD, respectively, per ton. The main purpose of this model is to accurately estimate production to ascertain cost objectives and operation of production to help corporations control related costs and increase profit.

Optimal Solution Analysis
The green production planning model for the example data is shown in Table 3, which is a mixed integer programming (MIP) model, and the optimal solution is shown in Table 4, which is obtained by using Lingo 16.0.
In Table 4, the optimal solution in the model indicates the optimal product portfolio where the profit is 3,361,133,000 NTD from three products and three by-products. The total revenue is (4,371,466,156 NTD) which is comprised of three products: Draw Textured Yarn (1,327,368 Three kinds of machine hours relate to false twisting (120,000), weaving (100,000), and dyeing and finishing (121,428.55). Carbon tax costs are (120,000,000 NTD), and CO 2 emission quantities are (1200/ton). Therefore, the mathematical programming in this model combining ABC and TOC, as well as the constraint of carbon emissions, can reduce production costs and enhance profit through the efficient distribution of resources.

Sensitivity Analysis of the Quantity Discount of Direct Material
Considering the quantity discount of direct material, this paper divided the material purchase discount pricing into high, medium and low degree levels [70,71]. This study used three segments of piecewise linear function, as shown in Figure 5. In Equations (35)- (40), this paper replaces the former material cost (C 1 M) to become three segments of piecewise discount (R 1 ·MT 1 +R 2 ·MT 2 +R 3 ·MT 3 ). For example, when the amount of material is more than MQ 1 , the material cost would become R 1 and the total material cost would be (R 2 MT 2 ). Table 3. Green production planning model for the example data.
Max π = (97,000 × X 11 + 135,000 × X 21 + 202,500 × X 22 + 570 × 0.04 × M + 2100 × 0.05 × X 12 + 2300 × 0.14 × X 22 ) − (65,000 × M + 7000 × m 22d + 1800 × m 22c + 1500 × m cem ) − [47,840,000 + (170 × Q 1 − 62,560,000 × η 1 )] − (1000 × TC 1 − 50,000,000 × δ 1 + 1500 × TC 2 − 75,000,000 × δ 2 ) + (60 × RE h + 120 × RE w ) − 500,000 Subject to Input-Output Relationship: X 1 − 0.96 × M = 0 X 1 = X 11 + X 12 X 2 − 0.95 × X 12 = 0 X 2 = X 21 + Subject to Direct Labor: Subject to Machine Hour: Subject to Batch-Level: M ≤ 5 × B 01 X 12 ≤ 1 × B 12 X 11 + 0.04 × M ≤ 0.5 × B 10 X 22 ≤ 1 × B 23 X 21 + 0.05 × X 12 ≤ 2 × B 20 X 22 + 0.14 × X 22 ≤ 3 × B 30 X 22 ≤ 3 × BS Subject to Carbon Tax Function: 7 × X 22 ≤ TC 0 + TC 1 + TC 2 TC 0 ≤ δ 0 × 50,000 50,000 × δ 1 < TC 1 TC 1 ≤ δ 1 × 170,000 δ 2 × 170,000 < TC 2 TC 2 ≤ δ 2 × 0.1E + 10 δ 0 + δ 1 + δ 2 = 1 Our corporation in this model obtains the highest discount pricing. It indicates that the material cost would be from R 2 to R 3 ; the quantities that a plant buys and the total cost of materials are shown as (MT 3 R 3 ): where: MT 1 The original price of the amount of material MT 2 The amount of material in the first gradation of the price discount MT 3 The amount of material in the second gradation of the price discount MQ 1 The original price of the maximum amount of material MQ 2 The maximum amount of material in the first gradation of the price discount ϕ 1 , ϕ 2 , ϕ 3 Special ordered sets of type 1 (SOS1). The summation of 0/1 variables is 1. Our corporation in this model obtains the highest discount pricing. It indicates that the material cost would be from R2 to R3; the quantities that a plant buys and the total cost of materials are shown as (MT3R3): π = P 1 X 11 + P 2 X 21 + P 3 X 22 + β 1 1-e 1 )M + β 2 1-e 2 )X 12 + β 3 ·e 3 X 22 -(R 1 ·MT 1 + R 2 ·MT 2 + R 3 ·MT 3 ) + C 2 m 22d + C 3 m 22c + C 4 m 22m -L 0 + η 1 r ot Q 1 -G 0 -δ 1 r c1 TC 1 -GC 0 ) + δ 2 r c2 TC 2 -GC 0 ) + C 5 Re-F, where: MT 1 The original price of the amount of material MT 2 The amount of material in the first gradation of the price discount MT 3 The amount of material in the second gradation of the price discount MQ 1 The original price of the maximum amount of material MQ 2 The maximum amount of material in the first gradation of the price discount φ 1 , φ 2 , φ 3 Special ordered sets of type 1 (SOS1). The summation of 0/1 variables is 1. Moreover, this research proposes a sensitivity analysis to measure the cost of materials in the discount pricing function to increase our understanding of material price in terms of how they affect a company's cost and revenue [72]. Sensitivity analysis in this model uses material discount cost and normal material cost to test three kinds of material cost. The interval of cost variation ratio (%) is 5%, Moreover, this research proposes a sensitivity analysis to measure the cost of materials in the discount pricing function to increase our understanding of material price in terms of how they affect a company's cost and revenue [72]. Sensitivity analysis in this model uses material discount cost and normal material cost to test three kinds of material cost. The interval of cost variation ratio (%) is 5%, from −20% to 20%. The results of the sensitivity analysis of the direct material discount are shown in Table 5. This research adjusted material cost (M) in the sensitivity analysis to estimate the impact on normal material cost with and without discount pricing. The price is altered by 5% from (−20%-20%). If (M)'s cost is raised 5%, the profit will be from (3,361,133 NTD to 3,225,716 NTD), and if the cost that includes discount pricing is changed, that profit would decrease from (3,361,133 NTD) to (3,510,091 NTD). When the cost is decreased by 10%, the profit is (3,496,549 NTD) without discount pricing, and including the discount, it is (3,753,841 NTD).
Even if the change is from 0% to 20% the other products would not change and earnings would be (158,103,200 NTD). However, when price of X 1 is decreased by 12% to (1251), the quantities of X 22 would become zero; when X 2 is raised to (75399) except for continuing decreased volume of X 1 (99,902) but changed rate to −16%, it is not too different from the original price for the product mix. On the other hand, if a corporation needs to increase profit, it only needs to increase the price of X 1 because the increased price would not reduce the quantities of products. However, when prices are down, this not only cuts down the quantities of all of products, but also reduces a firm's profit.
Therefore, the changed cost of material in the textile industry would not result in a significant change to a corporation's profit even if costs decrease by 20%; however, the profit only increased by $3,902,799. When the profit variation ratio (%) changed to 16.12%, this means that when the material cost changes, the corporation's profit would not increase or decrease significantly; even when considering discount pricing, the result is the same as the normal material cost.

Manufacturing Execution System for Production Control under Industry 4.0 in the Textile Industry
In the past, traditional manufacturing produced few types and huge amounts of products, but the Internet has currently changed the situation. Enterprises need to achieve rapid, small quantity and customization production. If an enterprise continues to transport and cooperate production data still in accordance with manual adjustment, then it simply cannot adapt to the demands of the current market [58].
Under Industry 4.0, the Manufacturing Execution System (MES) provides an important bridge between Shop Floor Control System (SFCS) and Enterprise Resource Planning (ERP) [55,57,73]. Compared to the old-fashioned MES, it is not only just scheduling, managing materials and contorting products to increase product yield and quality, but MES can collect data for cloud application and use data to control production process. There is also a need to embrace Corporate Social Responsibility (CSR) to effectively control carbon emissions, room temperature and sewage concentration [74].

Status Monitoring and Predictive Maintenance
MES can monitor the status of a plant and use the collected data for useful information about status monitoring and predictive maintenance. For successful status monitoring, MES need to meet the following conditions: first, a factory must be digitized and synchronized with networks to respond to actual situation changes in real time [75]. Second, three levels of enterprise management, production management and production must be vertically integrated via automation. Machine and plant control systems (PCS) shift data to react quickly to automation, and vertical integration can ensure that the information to other levels is accurate in the correct real time [76,77]. Third, the ability to exchange consistent data with other applications in production management level is an important attribute of the MES system; this is called horizontal integration. Fourth, the existing MES data are evaluated synthetically by data mining, and identify the quality data and process parameters' they are then adjusted according to a self-optimizing system [48,55]. Fifth, it identifies multiple correlation data, as well as combines the information from MES and plant data to provide meaningful intelligence. Finally, factory machines need preventive maintenance through the data collection and analyzing parameters, in addition to regular maintenance. It is prudent to be warned before a machine malfunctions, thus decreasing the occurrence of unforeseen downtimes [48,78].

Work-in-Process Tracking
In Industry 4.0, MES can effectively track WIP and reduce losses that WIP causes through the abovementioned features. Work in process tracking is a significant application that aims to control work order, batch and unit production [55,79,80]. Moreover, WIP tracking can efficiently support plants to reduce costly problems such as cancelled orders, assembly errors, line of products downtime, and product recalls. Thus, efficient WIP tracking can offer traceability in all activities, and can effectively increase manufacturing effectiveness. To enable corporations to collect critical data and accurately track progress, the fundamental in WIP tracking is to build on barcode labeling that can accurately identify each item, and to put in place scanning technologies that can scan items as they go through the manufacturing, assembling, maintenance or testing processes [81,82]. These technologies enable the collection of critical data and accurately track progress for full traceability. That is to say, a corporation can more timely track orders to produce related-products through WIP tracking. Moreover, it can reduce the overall cost of production by reducing aspects of inventory. Thus, by effectively controlling cost and reducing WIP, a company can achieve zero inventory that reduces inventory costs, increases turnover and enhances profit to achieve profit maximization [83][84][85].

Quality Control
Recently, mass production of customized products in the textile industry has become increasingly important, but pressure is put on quality by the delivery times demanded by customers. In order to control quality, a plant needs to automatically collect data and history information through sensors and IoT technology, and then analyze and optimize process parameters to adjust them with the actual situation, thereby controlling and improving product quality [86,87]. Therefore, the key to Industry 4.0 is real-time communication and machine to machine connection between all systems [88,89]. Machines and equipment exchange data by communicating with each other, and a "smart" plant can record, analyze and make adjustments on its own to enhance the manufacturing process. Due to the need to integrate complex information in real time, achieving stand-alone systems and transparency are the problems on the shop floor that human-machine interaction need to solve [3,38].

Discussion
Some issues related to the textile industry and the case company are discussed in this section.

Energy Saving Method for the Case Company
Equations (18) and (19) are the equations for the energy recycling of heat and water in dyeing factory, respectively. Figure 6 is the heat recovery and recycling system used for the desizing activity in dyeing factory of the case factory. Desizing is the activity of removing the size material from the warp yarns after the textile fabric is woven.

Energy Saving Method for the Case Company
Equations (18) and (19) are the equations for the energy recycling of heat and water in dyeing factory, respectively. Figure 6 is the heat recovery and recycling system used for the desizing activity in dyeing factory of the case factory. Desizing is the activity of removing the size material from the warp yarns after the textile fabric is woven. Traditionally, the fresh water is heated to 90 °C and put into the desizing machine and the hot wastewater created from the desizing machine is discharged into the wastewater treatment zone. The case company designed a heat recovery and recycling system. The fresh water is only heated to 33 °C and put into the system. On the other hand, the 85 °C water created from the desizing machine is put into the system. These two sources of water are blended in the system. After the processing of the system, 85% of the water with 80 °C returns to the desizing machine and 15% of the wastewater flows into the wastewater treatment zone for further processing. This method will save the energy and water costs and the total cost saving amount is (C 5 RE h + C 6 RE w ) in Equation (1). Figure 7 shows the waste-heat recycling system adopted in the case company.

From Waste Cinder to Eco-Brick
In addition to the recycling and reuse of wastewater and waste-heat, the case company also reuse the waste cinder produced from coal combustion in coal boiler. There are 10 tons of cinders generated from coal boiler. The cinders are non-toxic, harmless and suitable to be reused and processed into eco-bricks by using a special and precise high pressure forming process. The water permeable turf Traditionally, the fresh water is heated to 90 • C and put into the desizing machine and the hot wastewater created from the desizing machine is discharged into the wastewater treatment zone. The case company designed a heat recovery and recycling system. The fresh water is only heated to 33 • C and put into the system. On the other hand, the 85 • C water created from the desizing machine is put into the system. These two sources of water are blended in the system. After the processing of the system, 85% of the water with 80 • C returns to the desizing machine and 15% of the wastewater flows into the wastewater treatment zone for further processing. This method will save the energy and water costs and the total cost saving amount is (C 5 RE h +C 6 RE w ) in Equation (1). Figure 7 shows the waste-heat recycling system adopted in the case company.

Energy Saving Method for the Case Company
Equations (18) and (19) are the equations for the energy recycling of heat and water in dyeing factory, respectively. Figure 6 is the heat recovery and recycling system used for the desizing activity in dyeing factory of the case factory. Desizing is the activity of removing the size material from the warp yarns after the textile fabric is woven. Traditionally, the fresh water is heated to 90 °C and put into the desizing machine and the hot wastewater created from the desizing machine is discharged into the wastewater treatment zone. The case company designed a heat recovery and recycling system. The fresh water is only heated to 33 °C and put into the system. On the other hand, the 85 °C water created from the desizing machine is put into the system. These two sources of water are blended in the system. After the processing of the system, 85% of the water with 80 °C returns to the desizing machine and 15% of the wastewater flows into the wastewater treatment zone for further processing. This method will save the energy and water costs and the total cost saving amount is (C 5 RE h + C 6 RE w ) in Equation (1). Figure 7 shows the waste-heat recycling system adopted in the case company.

From Waste Cinder to Eco-Brick
In addition to the recycling and reuse of wastewater and waste-heat, the case company also reuse the waste cinder produced from coal combustion in coal boiler. There are 10 tons of cinders generated from coal boiler. The cinders are non-toxic, harmless and suitable to be reused and processed into eco-bricks by using a special and precise high pressure forming process. The water permeable turf

From Waste Cinder to Eco-Brick
In addition to the recycling and reuse of wastewater and waste-heat, the case company also reuse the waste cinder produced from coal combustion in coal boiler. There are 10 tons of cinders generated from coal boiler. The cinders are non-toxic, harmless and suitable to be reused and processed into eco-bricks by using a special and precise high pressure forming process. The water permeable turf eco-bricks can be sold in the market or be used to replace the asphalt surface inside the factory as shown in Figure 8. The quantity of eco-bricks in the model is shown in Equation (28), i.e., BP 3 = e 3 ×X 22 , and the revenue of the by-product eco-bricks is β 3 e 3 X 22 in Equation (1) eco-bricks can be sold in the market or be used to replace the asphalt surface inside the factory as shown in Figure 8. The quantity of eco-bricks in the model is shown in Equation (28), i.e., BP 3 = e 3 × X 22 , and the revenue of the by-product eco-bricks is β 3 e 3 X 22 in Equation (1). Figure 8. Eco-brick made from waste cinder and used in the factory.

Labor Skills and Job Losses Due to the Introduction of Industry 4.0
Some researchers claim that there are four important kinds of skills required for Industry 4.0: (1) Knowledge about Information and Communication Technology such as robots, machine to machine communication, IT security, data protection, and so on; (2) Ability to work with data such as basic statistical knowledge, visual data output and analysis, and so on; (3) Technical know-how about new manufacturing processes and machine maintenance related maintenance related activities; and (4)Person skills such as adaptability and ability to change, working in team, social and communication skills, mindset change for lifelong learning, and so on [89,90].
After introducing Industry 4.0, companies need to face the challenges to find the labor with the skills mentioned above. Besides, the companies may also want to retrain their existing labor by upskilling the workforce having the retaining jobs equipped with the new technologies or by re-skilling the workforce having the ceasing jobs to new jobs created by Industry 4.0. On the other hand, the employees need to change their mindset for continuously learning new technologies to transit to advanced manufacturing processes [89,91].
The Fourth Industrial Revolution is the annual meeting focus at the World Economic Forum (WEF) held in Davos, Swiss in January, 2016 [92]. The WEF reported that "It sees as many as 7.1 million jobs being lost, mostly in white-collar office and administrative roles, with the creation of 2.1 million new jobs in fields such as computer engineering and mathematics. It leads to a net loss of over 5 million jobs in 15 major developed and emerging economies" [92,93]. After introducing Industry 4.0, the manual labor was replaced by high-performance machines with Programmable logic controller or robotics with the accuracy of 99.9966% [94,95]. Only non-routine manual labor jobs are broadly unaffected [94].

Conclusions
This research combined Industry 4.0, Activity-Based Costing (ABC) and the Theory of Constraints (TOC) to achieve profit maximization, and proposes a green production planning model to deal with environmental issues [28,[96][97][98][99]. The textile industry is one of the world's major sources of industrial pollution; therefore, environmental issues are a major concern. This paper considered carbon emissions, energy recycle and waste reuse. It is found that an Industry 4.0 automated monitoring system will properly maintain and manage all production processes and immediately monitor and record all production process data. In the manufacturing process, it is necessary to effectively control carbon emissions. The carbon taxes must be considered to prompt enterprises to  (2) Ability to work with data such as basic statistical knowledge, visual data output and analysis, and so on; (3) Technical know-how about new manufacturing processes and machine maintenance related maintenance related activities; and (4) Person skills such as adaptability and ability to change, working in team, social and communication skills, mindset change for lifelong learning, and so on [89,90].
After introducing Industry 4.0, companies need to face the challenges to find the labor with the skills mentioned above. Besides, the companies may also want to retrain their existing labor by up-skilling the workforce having the retaining jobs equipped with the new technologies or by re-skilling the workforce having the ceasing jobs to new jobs created by Industry 4.0. On the other hand, the employees need to change their mindset for continuously learning new technologies to transit to advanced manufacturing processes [89,91].
The Fourth Industrial Revolution is the annual meeting focus at the World Economic Forum (WEF) held in Davos, Swiss in January, 2016 [92]. The WEF reported that "It sees as many as 7.1 million jobs being lost, mostly in white-collar office and administrative roles, with the creation of 2.1 million new jobs in fields such as computer engineering and mathematics. It leads to a net loss of over 5 million jobs in 15 major developed and emerging economies" [92,93]. After introducing Industry 4.0, the manual labor was replaced by high-performance machines with Programmable logic controller or robotics with the accuracy of 99.9966% [94,95]. Only non-routine manual labor jobs are broadly unaffected [94].

Conclusions
This research combined Industry 4.0, Activity-Based Costing (ABC) and the Theory of Constraints (TOC) to achieve profit maximization, and proposes a green production planning model to deal with environmental issues [28,[96][97][98][99]. The textile industry is one of the world's major sources of industrial pollution; therefore, environmental issues are a major concern. This paper considered carbon emissions, energy recycle and waste reuse. It is found that an Industry 4.0 automated monitoring system will properly maintain and manage all production processes and immediately monitor and record all production process data. In the manufacturing process, it is necessary to effectively control carbon emissions. The carbon taxes must be considered to prompt enterprises to control carbon emissions, and there must be an exploration of the use of renewable energy. This paper also focuses on the recycling of water and heat energy. Energy can be recycled and reused after being processed, not only for a green energy effect, but also to save more costs due to energy saving. Finally, this paper also the reuse of waste cinder. Coal is burned and produces waste cinder in a coal boiler. Cinder is usually regarded as waste. Its transportation cost is very high and burying cinder is very polluting to the environment. Therefore, mixing cinder with cement to form the solid and highly breathable eco-bricks, is not only environmental protective, but can also avoid the high cost of shipping, and so add to green manufacturing.
This research used mathematical programming approach to formulate the decision model with ABC cost data and TOC constraints for the textile companies. This research also clarified the relation between mathematical programming models and Industry 4.0 techniques. Managers in the textile companies can applied this decision model to achieve the optimal product-mix under various constraints and to evaluate the effect on profit of carbon emissions, energy recycling, waste reuse, and material quantity discount.
For the future works, the green production planning model proposed in this paper can be extended to incorporate the cap-and-trade feature [100] the companies can buy carbon emission right if they use up the carbon emission quota, otherwise they also can sell the surplus carbon emission right in the market. Also, this model can be extended to consider different carbon tax cost functions and their effects on profit.