## 5 Operation of the Switch
### Switch Algorithm
Figure 3: Operational flowchart for the proposed algorithm. * Here, value of PS changes based on the value assigned by the selectable PS algorithm, and PS selection algorithm operates before the switching algorithm. The data rate and the energy harvesting thresholds are values which entirely depend on the environmental conditions and the operational conditions expected by the users. The algorithm, when implemented in the switch, can be initialized with the performance expected by the user. The data rate requirement in specific IoT networks change, and in industrial settings, a higher focus may be given to energy harvesting rather than the data rate. The determination of parameters for data rate and energy are associated with the transmission environment (availability of a strong LoS), and the required freshness of data at the \(D\) node. For the scope of this paper, we assume that PS ratio optimization mechanisms available in the present literature are utilized directly [30; 31; 32]. The initialization of the energy threshold (ET) and the PS ratio are automated within the switch, allowing for less interference from the users. We assume that the PS ratio is initialized using a selectable PS optimization approach, which allows the users to allow the algorithm to determine the required PS ratio [33]. For the ET, it is assumed that an energy aware interface (EAI) is utilized [34]. This approach enhances the automation of the switch and reduces the manual involvement within the overall operation. This allows the system to be operated based on a monitoring mechanism that considers the available amount of energy within the battery, and the energy required for the transmission from \(R\) to \(D\) nodes. Based on the values obtained through the EAI, the system is capable of monitoring the energy availability of the switch and thereby updating the system about the required amount of energy. The HF represents the priority balance between EH and information transmission in the system. Expressed as a percentage, HF can be set to a lower value when neither EH nor information transmission requires precedence. However, the value needs to be adjusted based on the relative importance given to either energy harvesting or data transmission requirements in specific applications. For instance, in scenarios where energy harvesting is critical, a higher HF would ensure the system favors maintaining SWIPT operation when conditions are suitable. The HF parameter is, however, not initialized by the user or the system, and it is set as a fixed value within the switch. The calculation of HF required for the switch is based on the hardware and information requirements and is not considered within the scope of this work. To maintain ambiguity and flexibility of the switch operations towards its environment, we allow the users to provide the required minimum data rate as an input. The switch provides a data rate scale from 1 to 3, where 1 represents the lowest data rate with a minimum PS ratio of \(\rho_{min}\) for ID, and 3 represents highest data rate with a maximum PS ratio of \(\rho_{max}\) for ID. If the user selects either of these two, the selectable PS ratio mechanism limits its range of PS towards the lowest or highest ranges, respectively. However, if the user selects scale 2, this allows the switch to automate the operation, and the data rate is considered based on the PS ratio obtained by the selectable algorithm and EAI, while thresholds for the minimum and maximum operations are fed such that the switch would not operate on either extremes (here, the extremes are when PS ratio is modeled such that there is no ID or EH components). Under PS-SWIPT, once the selection is performed through the switch, the system needs to consider the optimal PS ratio for switching between EH and ID. Under the operational conditions of the switch, the selection for SWIPT is made if and only if the required conditions are met, and under a fixed environment, it can be assumed that the conditions at which the switch selects SWIPT are similar [35].