conf-250 #873

Merged
chenhao merged 5 commits from conf-250 into test 2024-12-09 14:49:26 +08:00
3 changed files with 5 additions and 2 deletions
Showing only changes of commit 23cfc8a897 - Show all commits

View File

@ -12,4 +12,5 @@ type StreamerFilterCfg struct {
CityWeight float64 `json:"city_weight"`
ConstellationWeight float64 `json:"constellation_weight"`
IsActiveWithinAWeekWeight float64 `json:"is_active_within_a_week_weight"`
PriorityWeight float64 `json:"priority_weight"`
}

View File

@ -32,7 +32,7 @@ type StreamerScoreFormulaCfg struct {
NewZoneMemberCountInAMonth *FormulaParam `json:"new_zone_member_count_in_a_month"`
MomentCountInThreeDays *FormulaParam `json:"moment_count_in_three_days"`
Priority []string
Priority []string // 优先级字段名,按打分权重排列(实际上formula的proportion应该定名weight)
}
func (s *StreamerScoreFormulaCfg) CalPriority() {

View File

@ -380,9 +380,10 @@ type StreamerScore struct {
NewZoneMemberCountInAMonth int64
MomentCountInThreeDays int64
RefundRate float64
Order int64 // 人工设置的排名,排名值越大,排位越靠前
Score float64
Priorities []float64
Priorities []float64 // 得分序列,依次为总分、第一优先级字段得分、第二优先级字段得分...
}
func (s *StreamerScore) SetPriority(names []string) {
@ -413,6 +414,7 @@ func (s *StreamerScore) CalScore(formula *apollostruct.StreamerScoreFormulaCfg)
s.Score += math.Min(100, float64(s.NewZoneMemberCountInThreeDays)/formula.NewZoneMemberCountInThreeDays.Maximum*100) * formula.NewZoneMemberCountInThreeDays.Proportion
s.Score += math.Min(100, float64(s.NewZoneMemberCountInAMonth)/formula.NewZoneMemberCountInAMonth.Maximum*100) * formula.NewZoneMemberCountInAMonth.Proportion
s.Score += math.Min(100, float64(s.MomentCountInThreeDays)/formula.MomentCountInThreeDays.Maximum*100) * formula.MomentCountInThreeDays.Proportion
s.Score +=
}
type ByScore []*StreamerScore