package com.tzld.piaoquan.ad.engine.service.predict.calculator;

import com.tzld.piaoquan.ad.engine.service.predict.param.ThresholdCalculateParam;

public class ThresholdPredictCalculator {

   public static <T extends ThresholdCalculateParam> Double basicCalculate(T param) {
      return param.getGroupShareRate()*param.getVideoShareRate();
   }

   public static <T extends ThresholdCalculateParam> Double multiplyCalculate(T param) {
      return param.getGroupShareRate()*param.getGroupOutRate()*param.getVideoShareRate()*param.getVideoOutRate();
   }

   public static <T extends ThresholdCalculateParam> Double addWeightCalculate(T param) {
      double groupRate= param.getShareWeight()* param.getGroupShareRate()+ param.getOutWeight()*param.getGroupOutRate();
      double videoRate= param.getShareWeight()* param.getVideoShareRate()+ param.getOutWeight()*param.getVideoOutRate();
      return groupRate*videoRate;
   }
}
