一个具备科研可验证性的 LoRa 多跳算法评估基线。
This commit is contained in:
@@ -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
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user