## 3 Method
### Mechanism of Self-Adaptive Collaboration  
In this part, based on the depiction of the proposed TCPN model, the mechanism of self-adaptive collaboration for production-logistics systems is investigated. The objective of the proposed TCPN model is to minimize the waiting time of all jobs, the makespan, and the electricity consumption of all machines and AGVs. Three KPIs including waiting time, makespan, and electricity consumption are considered. The KPI waiting time is used to calculate the total waiting time of all jobs. The waiting time represents the time between two sequential operations of the same job. The total waiting time of all jobs is mathematically formulated to minimize the objective \(\Delta T_{total}\) as follows:  
\[\text{Minimize }\Delta T_{total}=\sum\limits_{i=1}^{m-1}\sum\limits_{h=2}^{m} \sum\limits_{j=1}^{n}\Delta T_{ihj} \tag{1}\]  
\[\text{where }\Delta T_{ihj}=\Delta T_{ij}^{WA}+\Delta T_{lik}^{A}+\Delta T_{ hj}^{WB},\text{ for all }(i,j)\rightarrow(h,j) \tag{2}\]  
In Equations (1) and (2), the waiting time \(\Delta T_{ihj}\) is composed of three parts, namely the waiting time after processing \(\Delta T_{ij}^{WA}\), the transport time \(\Delta T_{ihk}^{A}\), and the waiting time before processing \(\Delta T_{hj}^{WB}\). \(\Delta T_{ij}^{WA}\) can be reduced by calling for AGVs once the job \(j\) begins being processed on machine \(i\). The transport time refers to the time cost of transporting materials between machines. \(\Delta T_{ihk}^{A}\) can be reduced by selecting the nearest available AGV and planning a time-saving route. \(\Delta T_{hj}^{WB}\) is influenced by the former two parts and is related to the production schedule. The KPI makespan is used to calculate the maximum completion time of all jobs. The makespan is mathematically formulated to minimize the objective \(C_{\text{max}}\) as follows:  
\[\text{Minimize }C_{\text{max}}=\underset{j}{\text{max}}C_{j} \tag{3}\]  
\[\text{where }C_{j}=y_{1j}+\sum\limits_{i=1}^{m}p_{ij}+\sum\limits_{i=1}^{m-1} \sum\limits_{h=2}^{m}\Delta T_{ihj},\text{ for all }(i,j)\rightarrow(h,j) \tag{4}\]  
In Equations (3) and (4), \(C_{j}\) denotes the completion time of the job \(j\), \(y_{1j}\) denotes the starting time of the first operation of the job \(j\), \(\underset{i=1}{\overset{m}{\sum}}p_{ij}\) denotes the processing time of the job \(j\), and \(\underset{i=1}{\overset{m-1}{\sum}}\underset{h=2}{\overset{m}{\sum}}\Delta T_ {ihj}\) denotes the total waiting time of the job \(j\). To reduce the makespan, the processing sequence or the processing speed of machines can be adjusted based on realities of the situation. The KPI electricity consumption is used to calculate the total electricity consumption of all machine tools and AGVs. The total electricity consumption is mathematically formulated to minimize the objective \(E_{total}\) as follows:  
\[\text{Minimize }E_{total}=\sum\limits_{i=1}^{m}E_{M}^{(i)}+\sum\limits_{k=1}^{ m}E_{AGV}^{(k)} \tag{5}\]  
\[\text{where }E_{M}^{(i)}=\int_{0}^{t}P_{M}^{(i)}(t)\text{d}t,\text{ }P_{M}^{(i)}=P_{MP}^{(i)}\text{ when processing, }P_{M}^{(i)}=P_{MI}^{(i)}\text{ when idle} \tag{6}\]\[E_{AGV}^{(k)}=\int_{0}^{t}P_{AGV}^{(k)}(t)\mathrm{d}t \tag{7}\]  
In Equations (5)-(7), \(E_{M}^{(i)}\) denotes the electricity consumption of machine \(i\), \(E_{AGV}^{(k)}\) denotes the electricity consumption of AGV \(j\), \(P_{M}^{(i)}\) denotes the power of the machine \(i\), \(P_{MP}^{(i)}\) denotes the average power of the machine \(i\) when processing, \(P_{MI}^{(i)}\) denotes the average power of the machine \(i\) when idle, and \(P_{AGV}^{(k)}\) denotes the average power of AGV \(k\). To reduce the total electricity consumption, the running time of all machines and AGVs should be shortened. In the proposed TCPN model, the smart machine can calculate the remaining time of current operations. The remaining time of operation \((i,j)\) can be formulated as follows.