Skip to content

Commit

Permalink
Merge pull request #118 from Team-Going/develop
Browse files Browse the repository at this point in the history
[release] v1.0.3 릴리즈
  • Loading branch information
SunwoongH authored Jan 18, 2024
2 parents 78225f8 + fdb9111 commit 7ec87b3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private void calculateAndSetPropensityAverageRate(List<String> keys, Map<String,
keys.forEach(key -> {
int rate = round((float) propensity.get(key) / participantCount);
boolean isLeft = rate <= MAX_STYLE_RATE - rate;
rate = calculatePropensityWeight(isLeft, rate);
response.add(TripStyleResponse.of(rate, isLeft));
});
}
Expand All @@ -141,4 +142,11 @@ private void setDefaultPropensity(Participant participant, Map<String, Integer>
propensity.put(STYLE_D, propensity.get(STYLE_D) + participant.getStyleD() * PROPENSITY_WEIGHT);
propensity.put(STYLE_E, propensity.get(STYLE_E) + participant.getStyleE() * PROPENSITY_WEIGHT);
}

private int calculatePropensityWeight(boolean isLeft, int rate) {
if (isLeft) {
rate = MAX_STYLE_RATE - rate;
}
return rate;
}
}

0 comments on commit 7ec87b3

Please sign in to comment.