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:
parent
857c5f0ae3
commit
44811e84fd
1 changed files with 6 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue