Commit 488a1b72 authored by 刘基明's avatar 刘基明

热度算法优化 参数

parent 58b6eaec
......@@ -48,17 +48,19 @@ public class RankService {
@Value("${rank.theme.initialWeight:1.0}")
public Double initialWeight;
//时间系数
@Value("${rank.theme.timeRaten:0.2}")
@Value("${rank.theme.timeRate:0.2}")
public Double timeRate;
@Value("${rank.topic.viewRate:1}")
public Double viewRateTopic;
public Double topicViewRate;
@Value("${rank.topic.discussRate:3}")
public Double discussRateTopic;
public Double topicDiscussRate;
@Value("${rank.topic.themeRate:1}")
public Double topicThemeRate;
//时间系数
@Value("${rank.theme.timeRaten:1}")
public Double timeRateTopic;
@Value("${rank.theme.timeRate:1}")
public Double topicTimeRate;
@Autowired
private ThemeService themeService;
......@@ -267,9 +269,9 @@ public class RankService {
if (topic.getIsTop() > 0) {
topic.setScore(Double.MAX_VALUE);
}
Double socre = ((topic.getDisscussCount() * discussRateTopic + topic.getViewCount() * viewRateTopic)
/ Math.pow(topic.getHoursTillNow() + 1, timeRateTopic))
+ topic.getThemeWeight();
Double socre = ((topic.getDisscussCount() * topicDiscussRate + topic.getViewCount() * topicViewRate)
/ Math.pow(topic.getHoursTillNow() + 1, topicTimeRate))
+ topic.getThemeWeight() * topicThemeRate;
topic.setScore(socre);
}
}
......@@ -106,3 +106,8 @@ rank:
userWeightRatio: 0.9
initialWeight: 1.0
timeRation: 0.2
topic:
viewRate: 2
discussRate: 3
themeRate: 3
timeRate: 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment