|
@@ -294,16 +294,16 @@ public class VideoAdThompsonScorerV2 {
|
|
|
.getSum();
|
|
|
}
|
|
|
|
|
|
- private Comparator<AdRankItem> equalsRandomComparator(){
|
|
|
+ private Comparator<AdRankItem> equalsRandomComparator() {
|
|
|
return new Comparator<AdRankItem>() {
|
|
|
@Override
|
|
|
public int compare(AdRankItem o1, AdRankItem o2) {
|
|
|
- if (o1.getScore() < o2.getScore()) {
|
|
|
- return 1;
|
|
|
- } else if (o1.getScore() > o2.getScore()) {
|
|
|
- return -1;
|
|
|
+ int comparison = o1.compareTo(o2);
|
|
|
+ if (comparison != 0) {
|
|
|
+ return comparison;
|
|
|
}
|
|
|
- return random.nextInt(20) - 10;
|
|
|
+ // 数字相等时随机排列
|
|
|
+ return random.nextInt(3) - 1; // 产生-1、0或1的随机值
|
|
|
}
|
|
|
};
|
|
|
}
|
|
@@ -410,13 +410,4 @@ public class VideoAdThompsonScorerV2 {
|
|
|
public void setExp666Param(String str){
|
|
|
this.exp663Param=gson.fromJson(str,Map.class);
|
|
|
}
|
|
|
-
|
|
|
- @Value("${ad.engine.new.thompson.exp.V2.666:{}}")
|
|
|
- public void setExp669Param(String str){
|
|
|
- this.exp663Param=gson.fromJson(str,Map.class);
|
|
|
- }
|
|
|
- @Value("${ad.engine.new.thompson.exp.V2.666:{}}")
|
|
|
- public void setExp670Param(String str){
|
|
|
- this.exp663Param=gson.fromJson(str,Map.class);
|
|
|
- }
|
|
|
}
|