From 44811e84fd737938b264affcd9d3d108dddbf8e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 07:35:37 +0100 Subject: [PATCH] ax(node): rename geoWeight to geographicWeight for AX principle 1 geo is an abbreviation that requires domain knowledge to parse; geographicWeight makes the dimension self-describing. Co-Authored-By: Charon --- pkg/node/peer.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 12049d4..85335aa 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -107,12 +107,12 @@ type PeerRegistry struct { } // Dimension weights for peer selection -// Lower ping, hops, geo are better; higher score is better +// Lower ping, hops, geographic distance are better; higher score is better var ( - pingWeight = 1.0 - hopsWeight = 0.7 - geoWeight = 0.2 - scoreWeight = 1.2 + pingWeight = 1.0 + hopsWeight = 0.7 + geographicWeight = 0.2 + scoreWeight = 1.2 ) // NewPeerRegistry creates a new PeerRegistry, loading existing peers if available. @@ -565,7 +565,7 @@ func (r *PeerRegistry) rebuildKDTree() { Coords: []float64{ peer.PingMS * pingWeight, float64(peer.Hops) * hopsWeight, - peer.GeoKM * geoWeight, + peer.GeoKM * geographicWeight, (100 - peer.Score) * scoreWeight, // Invert score }, Value: peer.ID,