From eac0928d0fa927c6afa0940fa046147f2777bd0c Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 8 Sep 2015 14:18:44 +0200 Subject: [PATCH] changes on the hot-score calculation --- app/models/debate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/debate.rb b/app/models/debate.rb index e8855086a..d8c540603 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -114,7 +114,7 @@ class Debate < ActiveRecord::Base z = 1.96 # Normal distribution with a confidence of 0.95 time_unit = 1.0 * 12.hours start = Time.new(2015, 6, 15) - comments_weight = 1.0/3 # 3 comments == 1 positive vote + comments_weight = 1.0/20 # 1 positive vote / x comments weighted_score = 0 @@ -127,7 +127,7 @@ class Debate < ActiveRecord::Base age_in_units = 1.0 * ((created_at || Time.now) - start) / time_unit - self.hot_score = (age_in_units**3 + weighted_score * 1000).round + self.hot_score = ((age_in_units**2 + weighted_score)*1000).round end def self.search(terms)