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 <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 07:35:37 +01:00
parent 857c5f0ae3
commit 44811e84fd
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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,