# Modified Echo State Network Enabled Dynamic Duty Cycle for Optimal Opportunistic Routing in EH-WSNs
## 3 Proposed Modified Echo State Network (MESN) Model
### Update the Position of the Current Solution
Therefore, the actual relay list L\({}_{actual}\) is built for each node in step-2 itself. For each sender node '\(k\),' the relay nodes set \(Set_{initial}^{k}\) are generated for further steps. The EATC of single-hop data forwarding,\(EATC\Big{(}T_{single-hop}^{kl}(t)\Big{)}\) at particular slot \(t\) is derived from the sum of transmission cost and the wait cost as given in Equation (20):  
\[EATC\Big{(}T_{single-hop}^{kl}(t)\Big{)}=cos\ t\Big{(}T_{multi}^{kl}(t)\Big{)}+cos \ t\Big{(}T_{transmission}^{kl}(t)\Big{)} \tag{20}\]  
The expected time interval between receiving a packet and beginning to send that packet to other nodes is known as wait cost. EATC of multi-hop data forwarding uses EATC of the single-hop and average EATC of subsequent relay nodes. It can be expressed as given in Equation (21):  
\[EATC\Big{(}T^{kl}(t)\Big{)}=EATC\Big{(}T_{single-hop}^{kl}(t)\Big{)}+\frac{ \sum_{q\in Set_{initial}^{l}}EATC\Big{(}T^{q}(t)\Big{)}}{size\Big{(}Set_{initial }^{l}\Big{)}} \tag{21}\]  
where \(size\Big{(}Set_{initial}^{l}\Big{)}\) is the size of the relay set, and \(EATC\Big{(}T_{single-hop}^{kl}(t)\Big{)}\) is the expected active transmission cost for a single hop of receiver node \(l\) in the relay node-set \(Set_{initial}^{k}\). Moreover, \(\frac{\sum_{q\in Set_{initial}^{l}}EATC\big{(}T^{q}(t)\big{)}}{size\big{(} Set_{initial}^{l}\big{)}}\) represents the average dynamic transmission cost of the relay node-set, \(\Big{(}Set_{initial}^{l}\Big{)}\). Next, we are explaining the prioritization of relay nodes. The relay nodes are prioritized primarily by applying the EATC. From the previously found relay set \(Set_{actual}\), we construct the actual relay list \(L_{actual}\) for each node based on EATC. The higher priority is assigned to relay nodes which are having lower EATC value. The step-3 (Figure 3) consists of the formation of the proposed MESN model. Here, we use the WOA for optimally selecting the weights of neurons in the reservoir layer of MESN. After successful training the model, the MESN predicts the expected energy acquisition of the next slot in the dynamic duty cycle scenario. In step-4 (Figure 3), updating of the dynamic duty cycle is performed. Here, the energy utilization of \((t+1)\)th time slot is nothing but the sum of the expected energy acquisition of the next time slot and the excess energy of the current time slot. It can be expressed as given in Equation (22):  
\[P_{U}^{k}(t+1)=P_{G}^{k}(t+1)+P_{ex}^{k}(t) \tag{22}\]  
where, \(P_{G}^{k}(t+1)\) denotes the expected energy gain of next time slot and \(P_{ex}^{k}(t)\) represents the excess energy in the current time slot. Similarly, the duty cycle updating can be expressed as given in Equation (23):  
\[DC_{act}^{k}(t+1)=DC_{k}\times min\Bigg{(}max\Bigg{(}\frac{P_{U}^{k}(t+1)-P_{T }}{P_{max}^{k_{T}}-P_{T}},0\Bigg{)}\,1\Bigg{)} \tag{23}\]  
where, for node \(k\), \(DC_{act}^{k}(t+1)\) represents the active time at slot \((t+1)\) and \(DC_{k}\) represents the duty cycle slot length. Also, \(P_{U}^{k}(t+1)\) refers to the energy utilization of \((t+1)\)th time slot, \(P_{max}^{k_{T}}\) represents maximum consumption of energy for a slot, and \(P_{T}\) represent the energy threshold. The active-duty cycle is referred as \(DC_{act}^{k}(t+1)\leq DC_{k}\) and, \(DC_{act}^{k}(t+1)=0\) represents that the node is entirely inactive for \((t+1)\)th time slot.