# Adaptive Jamming Mitigation for Clustered Energy-Efficient LoRa-BLE Hybrid Wireless Sensor Networks
## 3 Materials and Methods
### Energy Model
Initializeclusters:\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]1; Initializerouting table:\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]2; If(\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]3){ \[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]4; ForEach(SnodeinNearbyNodes){ If(\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]5){  Snnode.Nodegets\"LowPower\"\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]6NodeinJammingZone\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]7AlternativeRouters gets FindalternativeRouters(node, RoutingTable)\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]8AlternativeRouters|neqemptyest){  Snode.Routers getsSelectOptimalRoute(AlternativeRoutes)\[E_{\text{MC}}=T_{\text{MC}}\cdot I_{\text{MC}}\cdot V_{\text{MC}}\]9Node.Nodegets\"Isolated\"\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]0clusterinClusters\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]1cluster.ContainsNodes(JammingZone)\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]2cluster, NeighborClusters\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]3){ If(\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]4){ \[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]5; } Else{  Snode.TransmissionPowergetsReducePower()\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]6Metrics getsCollectMetrics()\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]7JammingZone getsDetectJamming(Metrics)\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]8JammingZone neg emptytest\[E_{\text{ON}}=T_{\text{ON}}\cdot I_{\text{ON}}\cdot V_{\text{ON}}\]9MitigationAlgorithm(Metrics,JammingZone)\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]0DetectJamming(Metrics)\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]1Metrics.Resilience>ResilienceThreshold\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]2Metrics.Retransmissions>RetransmissionsThreshold\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]3Metrics\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]4emptyset\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]5FindAlternativeRoutes(node,RoutingTable)\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]6AvailableRoutes|SetsFilterRoutes(RoutingTable,node,\"Active\")\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]7AvailableRoutes\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]8SelectOptimalRoute(Routes)\[E_{\text{OFF}}=T_{\text{OFF}}\cdot I_{\text{OFF}}\cdot V_{\text{OFF}}\]9SortedRoutesgetsSortsByPriority(Routes)\[E_{\text{Switching}}=T_{\text{Switching}}\cdot I_{\text{Switching}}\cdot V _{\text{Switching}}\]0SortedRoutes[0]$type+(Selectthemostoptimalroute.) }
```  
**Algorithm 4** Algorithm pseudocode of the optimal routes. node dynamically selects the most efficient communication mode based on real-time network conditions. Following protocol adaptation, the algorithm performs cluster head reconfiguration. Each node reassesses its cluster membership, and if necessary, a new cluster head is elected based on updated energy and communication quality metrics. This step is essential in maintaining stable and efficient routing structures under dynamic interference conditions. To further optimize energy consumption, the algorithm implements transmission power control. If the distance between a node and its cluster head is less than 20 m, the transmission power is set to a low level to conserve energy. Otherwise, a higher transmission power is used to ensure reliable data delivery over longer distances. The routing optimization phase evaluates alternative paths within the routing table.