diff --git a/doorip-api/src/main/java/org/doorip/common/Constants.java b/doorip-api/src/main/java/org/doorip/common/Constants.java index 7e05dc5..cb50cbc 100644 --- a/doorip-api/src/main/java/org/doorip/common/Constants.java +++ b/doorip-api/src/main/java/org/doorip/common/Constants.java @@ -14,5 +14,6 @@ public abstract class Constants { public static final String STYLE_D = "style_d"; public static final String STYLE_E = "style_e"; public static final int MIN_STYLE_RATE = 0; - public static final int MAX_STYLE_RATE = 4; + public static final int MAX_STYLE_RATE = 100; + public static final int PROPENSITY_WEIGHT = 25; } diff --git a/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java b/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java index 782e74e..4d13dc3 100644 --- a/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java +++ b/doorip-api/src/main/java/org/doorip/trip/service/TripDetailService.java @@ -132,10 +132,10 @@ private void calculateAndSetPropensityAverageRate(List keys, Map propensity) { - propensity.put(STYLE_A, propensity.get(STYLE_A) + participant.getStyleA()); - propensity.put(STYLE_B, propensity.get(STYLE_B) + participant.getStyleB()); - propensity.put(STYLE_C, propensity.get(STYLE_C) + participant.getStyleC()); - propensity.put(STYLE_D, propensity.get(STYLE_D) + participant.getStyleD()); - propensity.put(STYLE_E, propensity.get(STYLE_E) + participant.getStyleE()); + propensity.put(STYLE_A, propensity.get(STYLE_A) + participant.getStyleA() * PROPENSITY_WEIGHT); + propensity.put(STYLE_B, propensity.get(STYLE_B) + participant.getStyleB() * PROPENSITY_WEIGHT); + propensity.put(STYLE_C, propensity.get(STYLE_C) + participant.getStyleC() * PROPENSITY_WEIGHT); + propensity.put(STYLE_D, propensity.get(STYLE_D) + participant.getStyleD() * PROPENSITY_WEIGHT); + propensity.put(STYLE_E, propensity.get(STYLE_E) + participant.getStyleE() * PROPENSITY_WEIGHT); } }