一个具备科研可验证性的 LoRa 多跳算法评估基线。

This commit is contained in:
sinlatansen
2026-02-25 20:14:45 +08:00
parent 8537331c6f
commit 5ee1a16574
18 changed files with 1704 additions and 47 deletions

View File

@@ -109,7 +109,7 @@ class GradientRouting:
node_id=packet.src,
cost=neighbor_cost,
rssi=rssi,
last_hello_time=packet.rssi, # Use rssi field to store time
last_hello_time=rssi, # Use rssi field to store time
)
# Check if we should update our route
@@ -129,10 +129,13 @@ class GradientRouting:
return old_cost != self.cost
def get_next_hop(self) -> Optional[int]:
def get_next_hop(self, packet: Packet = None) -> Optional[int]:
"""
Get next hop towards sink.
Args:
packet: Optional packet (for compatibility)
Returns:
Parent node ID, or None if no route
"""