|
@@ -131,6 +131,7 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
sceneFeatureMap.put("dayofweek_" + DateUtils.getDayOrWeekByTimestamp(ts), "0.1");
|
|
|
sceneFeatureMap.put("hour", String.valueOf(DateUtils.getHourByTimestamp(ts)));
|
|
|
sceneFeatureMap.put("hour_quarter", String.valueOf(DateUtils.getHourQuarter(ts)));
|
|
|
+ sceneFeatureMap.put("ts", String.valueOf(ts));
|
|
|
return sceneFeatureMap;
|
|
|
}
|
|
|
|
|
@@ -203,8 +204,10 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
GuaranteeView guaranteeView = map.get(adVerId);
|
|
|
if (guaranteeView != null) {
|
|
|
double guaranteeWeight = calculateGuaranteedWeight(guaranteeView);
|
|
|
+ boolean isGuaranteed = isGuaranteed(guaranteeView);
|
|
|
ext.put("guaranteeView", guaranteeView.toString());
|
|
|
ext.put("guaranteeWeight", guaranteeWeight);
|
|
|
+ ext.put("isGuaranteed", isGuaranteed);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -239,6 +242,14 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
return guaranteeWeight;
|
|
|
}
|
|
|
|
|
|
+ protected boolean isGuaranteed(GuaranteeView guaranteeView) {
|
|
|
+ if (guaranteeView == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return guaranteeView.getGuaranteeNum() != null && guaranteeView.getGuaranteeNum() != 0
|
|
|
+ && guaranteeView.getGuaranteeRate() != null && guaranteeView.getGuaranteeRate() != 0.0;
|
|
|
+ }
|
|
|
+
|
|
|
protected double getGuaranteeScoreCoefficient(ScoreParam scoreParam, Map<String, Object> ext) {
|
|
|
if (ext.get("guaranteeWeight") != null && (double) ext.get("guaranteeWeight") == 0) {
|
|
|
return 0.0;
|