diff --git a/core/bandmap/bandmap.go b/core/bandmap/bandmap.go index 80433d1..29305e9 100644 --- a/core/bandmap/bandmap.go +++ b/core/bandmap/bandmap.go @@ -42,6 +42,7 @@ var defaultWeights = core.BandmapWeights{ AgeSeconds: -0.001, Spots: 0.001, Source: 0, + Quality: 0.01, } type Bandmap struct { diff --git a/core/bandmap/entries.go b/core/bandmap/entries.go index 2339570..d34e768 100644 --- a/core/bandmap/entries.go +++ b/core/bandmap/entries.go @@ -366,7 +366,11 @@ func (l *Entries) calculateWeightedValue(entry *Entry, now time.Time, weights co ageSeconds := now.Sub(entry.LastHeard).Seconds() spots := float64(entry.SpotCount) sourcePriority := float64(entry.Source.Priority()) - weight := 1 + (ageSeconds * weights.AgeSeconds) + (spots * weights.Spots) + (sourcePriority * weights.Source) + qualityFactor := 0.0 + if entry.Quality > core.BustedSpotQuality { + qualityFactor = float64(entry.Quality) + } + weight := 1 + (ageSeconds * weights.AgeSeconds) + (spots * weights.Spots) + (sourcePriority * weights.Source) + (qualityFactor * weights.Quality) return value * weight } diff --git a/core/core.go b/core/core.go index 88831e6..eb6e086 100644 --- a/core/core.go +++ b/core/core.go @@ -958,6 +958,7 @@ type BandmapWeights struct { AgeSeconds float64 Spots float64 Source float64 + Quality float64 } type VFO interface {