Modiﬁed Echo State Network Enabled Dynamic Duty Cycle for Optimal Opportunistic Routing in EH-WSNs

: Minimizing energy consumption is one of the major challenges in wireless sensor networks (WSNs) due to the limited size of batteries and the resource constrained tiny sensor nodes. Energy harvesting in wireless sensor networks (EH-WSNs) is one of the promising solutions to minimize the energy consumption in wireless sensor networks for prolonging the overall network lifetime. However, static energy harvesting in individual sensor nodes is normally limited and unbalanced among the network nodes. In this context, this paper proposes a modiﬁed echo state network (MESN) based dynamic duty cycle with optimal opportunistic routing (OOR) for EH-WSNs. The proposed model is used to act as a predictor for ﬁnding the expected energy consumption of the next slot in dynamic duty cycle. The model has adapted a whale optimization algorithm (WOA) for optimally selecting the weights of the neurons in the reservoir layer of the echo state network towards minimizing energy consumption at each node as well as at the network level. The adapted WOA enabled energy harvesting model provides stable output from the MESN relying on optimal weight selection in the reservoir layer. The dynamic duty cycle is updated based on energy consumption and optimal threshold energy for transmission and reception at bit level. The proposed OOR scheme uses multiple energy centric parameters for selecting the relay set oriented forwarding paths for each neighbor nodes. The performance analysis of the proposed model in realistic environments attests the beneﬁts in terms of energy centric metrics such as energy consumption, network lifetime, delay, packet delivery ratio and throughput as compared to the state-of-the-art-techniques. of


Introduction
Wireless sensor networks (WSNs) comprise a number of tiny sensor nodes for sensing and computation, transmission and reception for smart applications [1]. In WSNs, sensor nodes collect data about some targets and transmit sensed data to the sink node (or base station) via multiple hops [2]. Due to the ease of deployment, WSNs are utilized in many smart applications, such as security surveillance [3], disaster relief [4], IoT use cases [5], medical care [6], E-mobility [7], traffic management [8] and precision agriculture [9]. Enhancing the network lifetime and minimizing the packet delivery delays are some of the challenging tasks for WSNs based smart applications [10].

•
This article proposes the modified echo state network (MESN) which is used as a predictor for finding the expected energy acquisition of the next time slot. The proposed scheme is a novel research in this article and stops the unstable output of ESN due to the random weight selection Electronics 2020, 9,98 3 of 21 in the reservoir layer. This model utilizes the whale optimization algorithm (WOA) for optimally selecting the weights of the neurons in the reservoir layer of the echo state network.

•
In the optimal opportunistic routing (OOR) scheme, the relay set is selected using multiple parameters such as energy consumption, congestion rate and estimated duty-cycled wakeups (EDW). The relay set selection scheme selects appropriate forwarding paths for each forwarder node. • The proposed scheme achieves an optimized style to update duty cycle since it is updated based on energy consumption, energy acquisition of the next slot and energy threshold as the optimal energy is acquired from the prediction of the next slot with the help of the MESN model. • Finally, the comparison of the proposed technique with existing methods such as ESN, AOR, and Max-SNR in terms of performance parameters such as delay, packet delivery ratio and throughput is done. This reveals that the average percentage improvement of the proposed approach outperforms the existing techniques.
The organization of the article is as follows: Section 2 provides related work. Section 3 provides complete detail of the proposed MESN technique. Section 4 discusses the working structure of the MESN based OOR scheme. Section 5 describes the results of simulation and performance comparisons. Finally, Section 6 presents the conclusion of the paper.

Duty Cycled Wake Up Concept and Global Power Management Approach for Energy Harvesting Sensor Nodes
Ghadimi et al. [23] have assessed the opportunistic routing algorithm with new measurement; this scheme discusses to form candidate relay set from the localities of the sensor nodes based on the estimated duty-cycled wakeups (EDW). This step is required to transmit packets from source to destination efficiently. Castagnetti et al. [24] propose the global power management approach for energy harvesting sensor nodes, which depend on duty-cycle optimization and transmission power control.

Estimating the Harvested Energy, Relating Duty Cycle and Traffic Load
A new topological evolution model based on energy realization for WSNs is given by Cui et al. [25]. This model considers the changing nature of nodes and links. Mothku et al. [26] have proposed the model for estimating the harvesting energy. An essential aspect of this model is that it determines the residual energy for future time slots by using estimated harvesting energy, energy expenditure, and present residual energy. Next, a coherent model is given by Galmés et al. [27], which represents the energy expenditure of nodes in duty-cycled WSNs. This model provides a typical methodology for describing the duty cycle and traffic load for duty-cycle EH-WSNs. Further, an integrated scheme has been given by Sharma et al. [28], which consists of energy allocation postulates with an adjustable duty cycle scheme to proficiently utilizing the energy and therefore enhancing node operations.

Adaptive Duty Cycle Concept and Scheme for Enhancing the Node's Lifetime
Xiang et al. [29] have given an efficient scheme based on the adaptive duty cycle (ADC) concept. The main aim of ADC based opportunistic routing is to reduce the delay of nodes in WSN. In ADC based opportunistic routing scheme, the network delay reduces by increasing the node's duty cycle in particularly those regions where it has remaining energy. The duty cycle scheme can effectively reduce the energy consumption in WSNs. For increasing the node's lifetime and enhancing the node's usability in many areas, a rational next-door neighbor detection scheme is given by Gu et al. [30], the scheme also involves the systematic investigation of various next-door neighbor detection protocols and introduces the excellent next-door neighbor detection schedule. The main aim of the next-door neighbor detection issue in WSNs is to reduce the duty cycle.
Electronics 2020, 9, 98 4 of 21 In this article, we have compared the performance of the proposed scheme with existing schemes such as ESN based scheme, AOR and Max-SNR. The ESN-based scheme utilizes an ESN to get the energy acquisition of the next slot. In AOR, the concept of area subdivision method for dynamically selecting a relay set is utilized. Two crucial factors, such as left-over energy and range from the sink node, are considered while giving priority to the relay nodes. In Max-SNR, three essential factors, such as connection superiority, left-over energy and location are used for dynamically selecting the relay nodes and giving priority to relay nodes.

Proposed Modified Echo State Network (MESN) Model
In EH-WSNs, nodes can consistently harvest energy from the surroundings. However, the energy acquisition in EH-WSNs is usually deficient, time varied and unstable. The dynamic and heterogeneous duty cycle (DC) of nodes can be used to improve energy acquisition and hence, would keep the nodes operational for a longer time. It is noticeable that the traditional opportunistic packet-forwarding schemes in EH-WSNs do not consider the concept of dynamic DC while building, the relay set and selecting the forwarding paths. Thus, the performance is lower than expected by using conventional OPEH in EH-WSNs when dynamic DC is not used. Zhang et al. [20] have improved dynamic and heterogeneous DC methods but used the traditional ESN model utilizing random weight selection for neurons in the reservoir layer which may produce an unstable output. Therefore, in this article, MESN is utilized for the same purpose and the method is described next.
The proposed modification in ESN enhances the efficiency of predicting the expected energy acquisition precisely for enabling better duty cycle calculation. In traditional ESN, every cycle of the training phase consists of refreshing the weights of the neurons; until the error amongst output and input is within tolerance. The weights generated during the training phase will be used to test on the newer data. However, the weight selection procedure is time-consuming. This article overcomes this limitation by using WOA with ESN for optimally selecting the weights in the reservoir layer of ESN, named as MESN. MESN is an enhancement over the ESN. ESN is a neural network algorithm that has high correctness in guessing time-series data, regardless of whether the data fluctuate rapidly. Hence, ESN can be utilized to assess the time-sensitive fluctuating energy acquisition estimations of the next slot. ESN provides more accuracy in predicting expected energy acquisition compare to pure mathematical model-based algorithms, especially for a rapidly changing environment. ESN comprises three layers, namely the input layer, dynamic layer and the output layer, respectively. Also, ESN has the training and analyzing phases similar to the machine learning algorithm. During training, the weights of the neurons are refreshed in every cycle until the training error between output and input is within acceptable limits. However, the training of traditional ESN is time-consuming. We have proposed modified ESN for acquiring the optimal set of weights to be applied in the interconnection links of ESN for improving the trained prediction model. In modified ESN, the WOA is applied to choose the interconnection weights optimally. Figure 1 shows the proposed MESN and depicts the various layers.
Here, the input data is the expected active transmission cost (EATC) [20] of the active relay set, and the corresponding target is the expected energy acquisition value of the next time slot. Likewise, the training data is generated and trained with MESN. Here, input(t) represents input data, internal(t) represents neurons and output(t) represents output data. W input represents the weight matrix for input, W internal represents the weight matrix for neurons, and W output represents the weight matrix for output. During training, the training error is reduced depicted by Equation (1) below: Electronics 2020, 9, 98 5 of 21 Until the training error is reduced, the weights of the neurons are modified to generate the prediction model. Equation (2) represents the weights update mechanism for the neurons in the dynamic layer: where F() represents the activation function of the dynamic layer. Moreover, the following Equation (3) demonstrates the update in weight at the output layer: where F output () represents the linear activation function at the output layer.
Electronics 2020, 9, x FOR PEER REVIEW 5 of 21 where () represents the activation function of the dynamic layer. Moreover, the following Equation (3) demonstrates the update in weight at the output layer: where () represents the linear activation function at the output layer.

input(t) (input data)
Input Layer Here we have applied whale optimization algorithm (WOA) for optimal selection of weights to prevent unstable behaviour.
Reservoir/Internal/Dynamic Layer

Role of Whale Optimization Algorithm in the Modified Echo State Network (MESN) Model
The general acts of whales influence the working of the WOA. The WOA is used to raise the speed of the training process using optimally calculating the interconnection weights and is a metaheuristic algorithm. The following section shows the various steps of the WOA.

• Initialization
The algorithm is formed by randomly developing the initial solution (i.e., the interconnection weights of the ESN). The random value in the search space is as: where signifies the initial population of the whales at 'ℎ, ' i.e., number of interconnection links. •

Fitness Calculation
The fitness value of the solution is computed by: The fitness value is essential for becoming the best network structure. If the training error is minimum, it means that the network has been sufficiently trained to predict the energy acquisition values of the next time slot. Later, the best solution will be one having minimum training error.

Role of Whale Optimization Algorithm in the Modified Echo State Network (MESN) Model
The general acts of whales influence the working of the WOA. The WOA is used to raise the speed of the training process using optimally calculating the interconnection weights and is a metaheuristic algorithm. The following section shows the various steps of the WOA.

• Initialization
The algorithm is formed by randomly developing the initial solution (i.e., the interconnection weights of the ESN). The random value in the search space is as: where D signifies the initial population of the whales at 'h, ' i.e., number of interconnection links.

• Fitness Calculation
The fitness value of the solution is computed by: The fitness value is essential for becoming the best network structure. If the training error is minimum, it means that the network has been sufficiently trained to predict the energy acquisition values of the next time slot. Later, the best solution will be one having minimum training error.

Update the Position of the Current Solution
• Encircling prey Consider the below equations: where 't ' demonstrates a current iteration, → D refers a current state. Also: where, → b is reducing from 2 to 0, → o ∈ (0, 1).

• Exploitation phase
Two mechanisms are: 1) Shrinking encircling mechanism The Equation (8) shows this act, where the value of → b is reduced.
The equation is as follows: where It means the distance between the xth whale to the prey (which is the best set of weights attained so far), r takes value from [−1, 1], l s signifies the logarithmic spiral shape. During optimization, supposing a probability of 50%. Consider the below Equation (11). (11) where, O ∈ [0, 1].

• Exploration phase
The following equation demonstrates the exploration phase: where the current population random position vector is → D rand . Throughout every solution updating process, the fitness function is evaluated to find the best solution among them. Based on the best solution, a set of novel solutions will be generated, and the fitness is again evaluated to continue the above solution updating steps.
• Termination criteria The termination criteria of WOA include the best interconnection weights. As a result of finding the optimal interconnection weights, the prediction model is qualified. Since the objective is to become the weights for which the training error is minimum, the prediction model, achieved for the best weights, is well qualified to predict for unknown data. When the training procedure is stable, the proposed modified ESN(MESN) can be used to predict the energy acquisition values of the next time slot, on giving the EATC values of the previous time slot. Figure 2 shows the flow diagram of the WOA algorithm.

The Working Structure of the Proposed Modified Echo State Network (MESN) Based Dynamic Duty Cycle (DC) with Optimal Opportunistic Routing (OOR)
In the OOR scheme, the relay set is initially selected using multiple parameters such as energy consumption, congestion rate, and estimated duty-cycled wakeups (EDW) [23]. Further, appropriate forwarding path is selected from the relay sets of each of the direct neighbor nodes. In Figure 3, a complete working structure of MESN enabled OOR is detailed.
The formation of the initial relay set Setinitial for all nodes utilizes multiple parameters such as energy consumption [31], congestion rate [32], and the EDW. In the first step, we use multiple parameters for relay selection. Therefore, we have named this approach a hybrid relay selection mechanism.

The Working Structure of the Proposed Modified Echo State Network (MESN) Based Dynamic Duty Cycle (DC) with Optimal Opportunistic Routing (OOR)
In the OOR scheme, the relay set is initially selected using multiple parameters such as energy consumption, congestion rate, and estimated duty-cycled wakeups (EDW) [23]. Further, appropriate forwarding path is selected from the relay sets of each of the direct neighbor nodes. In Figure 3, a complete working structure of MESN enabled OOR is detailed. Initially, build a relay set for each node by considering multiple parameters as following.

Energy Consumption
Step-1 Step-2 Step-3 Step-4 Duty cycle is updated based on energy consumption, acquisition and energy threshold.
Get energy acquisition of next time slot ( + 1) Now we are explaining the various parameters used for relay selection as follows:

Expected number of duty cycle wakeups (EDW)
The energy consumption in the data transmission mechanism consists of three parts, such as energy consumption in sending data, energy consumption in receiving data and energy consumption for the fusion of data [31]. The energy consumption in sending data can be expressed as given in Equation (14): The formation of the initial relay set Set initial for all nodes utilizes multiple parameters such as energy consumption [31], congestion rate [32], and the EDW. In the first step, we use multiple parameters for relay selection. Therefore, we have named this approach a hybrid relay selection mechanism. Now we are explaining the various parameters used for relay selection as follows: The energy consumption in the data transmission mechanism consists of three parts, such as energy consumption in sending data, energy consumption in receiving data and energy consumption for the fusion of data [31]. The energy consumption in sending data can be expressed as given in Equation (14): Here, D is the distance for sending n bits data, E circuit_loss_sending represents energy consumption due to the circuit loss and E circuit_loss_ampli f ication shows the energy consumption due to the amplification circuit loss. Similarly, the energy consumption in sending into two different transmission environments, namely, free space and multipath can be expressed as given in Equation (15): E transmitting_unit_bit represent energy consumption in sending unit bit data, ε f ree_space shows energy consumption of unit bit in free space and ε multi_path demonstrates energy consumption of unit bit in multi-path, and D 0 = ε f ree_space ε multi_path . Similarly, the energy consumption in receiving n bit data can be expressed as given in Equation (16): Similarly, the energy consumption in n bit data fusion can be expressed as given in Equation (17): where, E f use_unit_bit_data shows energy consumption in unit bit data fusion. The congestion rate (CR) [24] is used to evaluate the load of relay nodes. Here, each intermediate node can adaptively detect the occurrence of congestion and then notify the parent node to reduce the packet delivery rate according to the congestion level. The CR at each neighbor node can be expressed as given in Equation (18): Here Connectivity_degree(n i ) represents degree of connectivity, and L ij is the route. The relay set formation from the neighborhoods of the sensor nodes utilizes the concept of the EDW required to transmit packets from source to destination efficiently [23]. The EDW of particular node i can be expressed as given in Equation (19): is the expected number of duty cycle wakeups in single-hop transmission, and is the expected number of duty cycle wakeups in multi hop transmission, and weight represent the forwarding cost in terms of energy. Also, Link_Parameter (i,j) represents success probabilities and Forwarder_set(i) denotes the set of candidate forwarders.
Next, we collect the current duty cycle of relay nodes from the initial relay set Set initial generated in step-1 (Figure 3). The relay set is updated based on the current duty cycle of relay nodes, and Set actual is the updated relay set. The step-2 ( Figure 3) consists of two primary functions, namely; calculation of expected active transmission cost (EATC) and prioritization of relay nodes by using EATC. 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 k initial are generated for further steps. The EATC of single-hop data forwarding, EATC T kl single−hop (t) at particular slot t is derived from the sum of transmission cost and the wait cost as given in Equation (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): where size Set l initial is the size of the relay set, and EATC T kl single−hop (t) is the expected active transmission cost for a single hop of receiver node l in the relay node-set Set k initial . Moreover, size(Set l initial ) represents the average dynamic transmission cost of the relay node-set, Set l initial . 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): where, P k G (t + 1) denotes the expected energy gain of next time slot and P k ex (t) represents the excess energy in the current time slot. Similarly, the duty cycle updating can be expressed as given in Equation (23): where, for node k, DC k act (t + 1) represents the active time at slot (t + 1) and DC k represents the duty cycle slot length. Also, P k U (t + 1) refers to the energy utilization of (t + 1)th time slot, P k T max represents maximum consumption of energy for a slot, and P T represent the energy threshold. The active-duty cycle is referred as DC k act (t + 1) ≤ DC k and, DC k act (t + 1) = 0 represents that the node is entirely inactive for (t + 1)th time slot.

Results and Discussion
In this section, the MESN based dynamic DC with OOR for EH-WSNs is analyzed using network simulator (NS2), the performance analysis uses two simulation scenarios. In the first simulation scenario, the sensor nodes vary from 100 to 500 in the network region 1000 m × 1000 m. In the second simulation scenario, the average energy harvesting rate ranges from 20, 40, 60, 80, and 100 mW with a fixed number of nodes as 500. Each sensor node is having initial energy of 0.5 J in the region. For sending a single packet of size 512 bytes per node, the transmission energy per node is 2.9 × 10 −3 J, also receiving energy per node is 0.20 × 10 −3 J. The transmission range of each sensor node is 150 m.
Here, every node uses the AODV routing protocol for packet transmission. This scenario also uses MAC protocol 802_11. Each sensor node uses an omnidirectional antenna. Also, this scenario uses the two-ray ground radio propagation model. The simulation time is 100 s, and the transmission rate is 500 kbps. Also, this section consists of a comparison of the proposed scheme with the existing state-of-art techniques such as ESN-based, AOR and Max-SNR in terms of parameters such as delay, packet delivery ratio and throughput.

Impact of Varying the Number of Sensor Nodes
Considering this scenario, we vary the node numbers as 100, 200, 300, 400, and 500 in the experiments. Figure 4 displays the comparison of the proposed OOR scheme with the existing schemes in terms of delay. The graph demonstrates that the delay of our proposed OOR scheme is lower than the existing ESN based, AOR, and Max-SNR schemes respectively.

Impact of Varying the Number of Sensor Nodes
Considering this scenario, we vary the node numbers as 100, 200, 300, 400, and 500 in the experiments. Figure 4 displays the comparison of the proposed OOR scheme with the existing schemes in terms of delay. The graph demonstrates that the delay of our proposed OOR scheme is lower than the existing ESN based, AOR, and Max-SNR schemes respectively. From the above Figure 4 it can be observed that delay reduces as the number of nodes increases. In OOR, the possibility of selecting the sleeping node as the relay node is less; therefore, the packet is transmitted from source to destination without much delay. Next, Table 1 depicts the performance measurement of the OOR scheme with variation in the number of nodes. Also, Table 1 shows the percentage improvement and average percentage improvement. In case of delay, the average percentage improvement of OOR is 22.18, 44.11, and 55.49 as compared to ESN based, AOR, and Max-SNR, respectively. We can show the performance comparison of OOR in a more detailed way in the following Figure 5. From the above Figure 4 it can be observed that delay reduces as the number of nodes increases. In OOR, the possibility of selecting the sleeping node as the relay node is less; therefore, the packet is transmitted from source to destination without much delay. Next, Table 1 depicts the performance measurement of the OOR scheme with variation in the number of nodes. Also, Table 1 shows the percentage improvement and average percentage improvement. In case of delay, the average percentage improvement of OOR is 22.18, 44.11, and 55.49 as compared to ESN based, AOR, and Max-SNR, respectively. We can show the performance comparison of OOR in a more detailed way in the following Figure 5. In Figure 5 the five different columns in the first part of the figure show the outcomes of the delay parameter with variation in the number of nodes for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 92 ms at 100 nodes, whereas the fifth column depicts the value of 20 ms at 500 nodes. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column represents the average percentage improvement. Figure 6 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The result indicates that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN based, Max-SNR, and AOR schemes, respectively. Concerning the above graph, increasing the number of nodes, packet delivery ratio (PDR) increases; this shows the perfect agreement with the theoretical background. In our proposed scheme, the possibility of selecting the sleeping forwarder node is very less because we have applied the multistage relay set optimization mechanism, which results in a higher packet delivery ratio. Hence, we can say that the proposed OOR is the best solution out of various algorithms available in the literature. Further, Table 2 depicts the performance of the OOR scheme with variation in the number of nodes. Also, Table 2 shows the percentage improvement and average percentage improvements both. In Figure 5 the five different columns in the first part of the figure show the outcomes of the delay parameter with variation in the number of nodes for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 92 ms at 100 nodes, whereas the fifth column depicts the value of 20 ms at 500 nodes. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column represents the average percentage improvement. Figure 6 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The result indicates that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN based, Max-SNR, and AOR schemes, respectively.
Concerning the above graph, increasing the number of nodes, packet delivery ratio (PDR) increases; this shows the perfect agreement with the theoretical background. In our proposed scheme, the possibility of selecting the sleeping forwarder node is very less because we have applied the multistage relay set optimization mechanism, which results in a higher packet delivery ratio. Hence, we can say that the proposed OOR is the best solution out of various algorithms available in the literature. Further, Table 2 depicts the performance of the OOR scheme with variation in the number of nodes. Also, Table 2 shows the percentage improvement and average percentage improvements both. In Figure 5 the five different columns in the first part of the figure show the outcomes of the delay parameter with variation in the number of nodes for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 92 ms at 100 nodes, whereas the fifth column depicts the value of 20 ms at 500 nodes. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column represents the average percentage improvement. Figure 6 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The result indicates that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN based, Max-SNR, and AOR schemes, respectively. Concerning the above graph, increasing the number of nodes, packet delivery ratio (PDR) increases; this shows the perfect agreement with the theoretical background. In our proposed scheme, the possibility of selecting the sleeping forwarder node is very less because we have applied the multistage relay set optimization mechanism, which results in a higher packet delivery ratio. Hence, we can say that the proposed OOR is the best solution out of various algorithms available in the literature. Further, Table 2 depicts the performance of the OOR scheme with variation in the number of nodes. Also, Table 2 shows the percentage improvement and average percentage improvements both.  Next for the packet delivery ratio, the average percentage improvement of OOR is 21.94, 40.46, and 58.40 as compared to ESN based, Max-SNR, and AOR, respectively.
We can show the performance comparison of OOR in a more presentable way in the following Figure 7.  We can show the performance comparison of OOR in a more presentable way in the following Figure 7. In Figure 7, again, the five different columns in the first part of the figure show the outcomes of the packet delivery ratio parameter with variation in the number of nodes for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the second column represents the value of the packet delivery ratio parameter as 77 at 200 nodes, whereas the fifth column depicts the value 92 at 500 nodes. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column describes the average percentage improvement. Figure 8 depicts the comparison of the proposed OOR scheme with the existing schemes in terms of throughput. The graph demonstrates that the throughput of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR, and AOR schemes, respectively.
From the above Figure 8, it is noticeable that as the number of nodes increases, throughput decreases, and the reason behind it is that the probability of packet error is proportional to the number of nodes. Therefore, the number of nodes increases, the packet error also increases, results in decreasing throughput. Moreover, Table 3 depicts the performance of the OOR scheme with variation in the number of nodes. Furthermore, Table 3 shows the percentage improvement and average percentage improvements both. In Figure 7, again, the five different columns in the first part of the figure show the outcomes of the packet delivery ratio parameter with variation in the number of nodes for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the second column represents the value of the packet delivery ratio parameter as 77 at 200 nodes, whereas the fifth column depicts the value 92 at 500 nodes. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column describes the average percentage improvement. Figure 8 depicts the comparison of the proposed OOR scheme with the existing schemes in terms of throughput. The graph demonstrates that the throughput of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR, and AOR schemes, respectively.  From the above table, the average percentage improvement of OOR is 17.02, 33.01, and 47.72 as compared to ESN based, Max-SNR, and AOR respectively. Further, we can show the performance comparison of OOR in a more descriptive way in the following Figure 9.  From the above Figure 8, it is noticeable that as the number of nodes increases, throughput decreases, and the reason behind it is that the probability of packet error is proportional to the number of nodes. Therefore, the number of nodes increases, the packet error also increases, results in decreasing throughput. Moreover, Table 3 depicts the performance of the OOR scheme with variation in the number of nodes. Furthermore, Table 3 shows the percentage improvement and average percentage improvements both. From the above table, the average percentage improvement of OOR is 17.02, 33.01, and 47.72 as compared to ESN based, Max-SNR, and AOR respectively. Further, we can show the performance comparison of OOR in a more descriptive way in the following Figure 9.   Table 3. We use the 100 scale for better representation of columns in the figure. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement.

Impact of Varying Average Energy Harvesting Rate
In this scenario, we vary the average energy-harvesting rate as 20, 40, 60, 80, and 100 mW with a fixed number of nodes as 500. Figure 10 demonstrates the comparison of the proposed OOR scheme with existing schemes. In terms of delay. The analysis demonstrates that the delay of the proposed OOR scheme is lower than the existing ESN-based, AOR, and Max-SNR schemes, respectively.  Table 3. We use the 100 scale for better representation of columns in the figure. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement.

Impact of Varying Average Energy Harvesting Rate
In this scenario, we vary the average energy-harvesting rate as 20, 40, 60, 80, and 100 mW with a fixed number of nodes as 500. Figure 10 demonstrates the comparison of the proposed OOR scheme with existing schemes. In terms of delay. The analysis demonstrates that the delay of the proposed OOR scheme is lower than the existing ESN-based, AOR, and Max-SNR schemes, respectively. From the above Figure 10 it can find out that delay decreases with an increase in average energy harvesting rate, and the reason behind is that the number of nodes is 500, and the average energy harvesting rate is increasing gradually from 20, 40, 60, 80 and 100 mW. Now active relay nodes will be high as compared with sleeping relay nodes, and consequently, the delay will decrease. Next, Table 4 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 4 shows the percentage improvement and average percentage improvements both. From the above Figure 10 it can find out that delay decreases with an increase in average energy harvesting rate, and the reason behind is that the number of nodes is 500, and the average energy harvesting rate is increasing gradually from 20, 40, 60, 80 and 100 mW. Now active relay nodes will be high as compared with sleeping relay nodes, and consequently, the delay will decrease. Next, Table 4 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 4 shows the percentage improvement and average percentage improvements both. In case of delay, the average percentage improvement of OOR is 38.17, 59.03, and 67.03 as compared to ESN-based, AOR, and Max-SNR respectively. Further, we can show the performance comparison of OOR in a more illustrative way in the following Figure 11. In case of delay, the average percentage improvement of OOR is 38.17, 59.03, and 67.03 as compared to ESN-based, AOR, and Max-SNR respectively. Further, we can show the performance comparison of OOR in a more illustrative way in the following Figure 11. In Figure 11, the five different columns in the first part of the figure show the outcomes of the delay parameter with variation in average energy harvesting rates for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 80 ms at 20 mW average energy harvesting rate whereas the fifth column depicts the value of 7.85 ms at 100 mW average energy harvesting rate. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement. Figure 12 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The graph clearly shows that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR, and AOR schemes, respectively. In Figure 11, the five different columns in the first part of the figure show the outcomes of the delay parameter with variation in average energy harvesting rates for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 80 ms at 20 mW average energy harvesting rate whereas the fifth column depicts the value of 7.85 ms at 100 mW average energy harvesting rate. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement. Figure 12 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The graph clearly shows that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR, and AOR schemes, respectively.
Here also, it may be observed that increasing the average harvesting rate, packet delivery ratio (PDR) increases, in this case, we have fixed the number of nodes as 500, and the average energy-harvesting rate is increasing gradually. Due to the multistage relay set optimization mechanism, the possibility of selecting the sleeping forwarder node is very less in our approach. Next, Table 5 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 5 shows the percentage improvement and average percentage improvements both.
delay parameter with variation in average energy harvesting rates for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the first column represents the value of delay parameter as 80 ms at 20 mW average energy harvesting rate whereas the fifth column depicts the value of 7.85 ms at 100 mW average energy harvesting rate. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement. Figure 12 demonstrates the comparison of the packet delivery ratio of the proposed OOR scheme and existing schemes. The graph clearly shows that the packet delivery ratio of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR, and AOR schemes, respectively.   Next for the packet delivery ratio, the average percentage improvement of OOR is 14.70, 36.80, and 51.43 as compared to ESN-based, Max-SNR, and AOR, respectively. Further, we can show the performance comparison of OOR in a more detailed way in the following Figure 13. Here also, it may be observed that increasing the average harvesting rate, packet delivery ratio (PDR) increases, in this case, we have fixed the number of nodes as 500, and the average energyharvesting rate is increasing gradually. Due to the multistage relay set optimization mechanism, the possibility of selecting the sleeping forwarder node is very less in our approach. Next, Table 5 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 5 shows the percentage improvement and average percentage improvements both. Next for the packet delivery ratio, the average percentage improvement of OOR is 14.70, 36.80, and 51.43 as compared to ESN-based, Max-SNR, and AOR, respectively. Further, we can show the performance comparison of OOR in a more detailed way in the following Figure 13. In Figure 13, the five different columns in the first part of the figure show the outcomes of the packet delivery ratio parameter with variation in average energy harvesting rates for each scheme, respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the second column represents the value of the packet delivery ratio parameter as 66.25 at 40 mW average energy harvesting rate whereas the fifth column depicts the value of 90 at 100 mW In Figure 13, the five different columns in the first part of the figure show the outcomes of the packet delivery ratio parameter with variation in average energy harvesting rates for each scheme, Electronics 2020, 9, 98 18 of 21 respectively. For example, consider different columns of the OOR scheme in the first part of the figure; the second column represents the value of the packet delivery ratio parameter as 66.25 at 40 mW average energy harvesting rate whereas the fifth column depicts the value of 90 at 100 mW average energy harvesting rate. In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement. Figure 14 illustrates the comparison of throughput of the proposed OOR scheme and existing schemes. The analysis demonstrates that the throughput of the proposed OOR scheme is higher than the existing ESN-based, Max-SNR and AOR schemes respectively. Electronics 2020, 9, x FOR PEER REVIEW 18 of 21 Here also from Figure 14, it is noticeable that as average energy harvesting rate increases, throughput decreases, and this is because the probability of packet error is proportional to the increase in the number of nodes. Though in this scenario, the number of nodes is fixed as 500 when 500 nodes start communication, then the probability of packet error start increasing and result in decreasing throughput. Next, Table 6 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 6 shows the percentage improvement and average percentage improvements both.   Figure 15. Here also from Figure 14, it is noticeable that as average energy harvesting rate increases, throughput decreases, and this is because the probability of packet error is proportional to the increase in the number of nodes. Though in this scenario, the number of nodes is fixed as 500 when 500 nodes start communication, then the probability of packet error start increasing and result in decreasing throughput. Next, Table 6 depicts the performance of the OOR scheme with variation in the average energy harvesting rates. Also, Table 6 shows the percentage improvement and average percentage improvements both. Last for throughput, the above table reveals that the average percentage improvement of OOR is 30.35, 48.76, and 63.15 as compared to ESN-based, Max-SNR, and AOR, respectively. Further, we can show the performance comparison of OOR in a more detailed way in the following Figure 15. In Figure 15, the five different columns in the first part of the figure show the outcomes of the throughput parameter in 100 scale with variation in average energy-harvesting rates for each scheme, respectively. For example, consider different columns of OOR scheme in first part of figure, the third column represents the value of throughput parameter as 76.2 (packets/s) at 60 mW average energy harvesting rate in 100 scale whereas the fifth column depicts the value 57.25 (packets/s) at 100 mW average energy harvesting rate in 100 scale. We use the 100 scale for better representation of columns in the figure. The values can be verified from above Table 6 In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement.

Conclusions
This article proposes the MESN-based dynamic DC with OOR for EH-WSNs. The proposed MESN model is used to act as a predictor for finding the expected energy acquisition of the next slot. The proposed modified echo state network (MESN) model comprises a WOA for optimally selecting the weights of the neurons in the reservoir layer of the echo state network. The proposed scheme is the novel research in this article for stopping the unstable output of ESN due to random weight selection in the reservoir layer. It is noticeable that the proposed MESN model overcomes the shortcomings of ESN. The OOR scheme also utilized a hybrid relay selection and duty cycle optimization scheme. Relay set is optimally selected using multiple parameters such as energy consumption, congestion rate and EDW. Finally, the duty-cycle is adjusted based on energy consumption, energy acquisition, and energy threshold. The average percentage improvements of the suggested OOR scheme with existing state-of-art techniques clear that the suggested scheme performs outstands than existing schemes.  In Figure 15, the five different columns in the first part of the figure show the outcomes of the throughput parameter in 100 scale with variation in average energy-harvesting rates for each scheme, respectively. For example, consider different columns of OOR scheme in first part of figure, the third column represents the value of throughput parameter as 76.2 (packets/s) at 60 mW average energy harvesting rate in 100 scale whereas the fifth column depicts the value 57.25 (packets/s) at 100 mW average energy harvesting rate in 100 scale. We use the 100 scale for better representation of columns in the figure. The values can be verified from above Table 6 In the second part of the figure, the five different columns show the percentage improvement, and the sixth column depicts the average percentage improvement.

Conclusions
This article proposes the MESN-based dynamic DC with OOR for EH-WSNs. The proposed MESN model is used to act as a predictor for finding the expected energy acquisition of the next slot. The proposed modified echo state network (MESN) model comprises a WOA for optimally selecting the weights of the neurons in the reservoir layer of the echo state network. The proposed scheme is the novel research in this article for stopping the unstable output of ESN due to random weight selection in the reservoir layer. It is noticeable that the proposed MESN model overcomes the shortcomings of ESN. The OOR scheme also utilized a hybrid relay selection and duty cycle optimization scheme. Relay set is optimally selected using multiple parameters such as energy consumption, congestion rate and EDW. Finally, the duty-cycle is adjusted based on energy consumption, energy acquisition, and energy threshold. The average percentage improvements of the suggested OOR scheme with existing state-of-art techniques clear that the suggested scheme performs outstands than existing schemes.