From c686684c60cd000a741d88963acef460f26284cf Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Mon, 28 Jul 2008 22:49:27 +0000 Subject: [PATCH] Altered calculate_credit_multiplier to make multiplier calculation more stable. svn path=/trunk/boinc/; revision=15701 --- checkin_notes | 6 ++++++ tools/calculate_credit_multiplier | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 679c05221c..d7ab5748d6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6002,3 +6002,9 @@ David 28 July 2008 html/ops/ repair_forums.php db_update.php + +Eric 28 July 2008 + - modified the credit multiplier calculation to make it more stable. + + tools/ + calculate_credit_multiplier diff --git a/tools/calculate_credit_multiplier b/tools/calculate_credit_multiplier index 031e77f601..9cd3a758da 100755 --- a/tools/calculate_credit_multiplier +++ b/tools/calculate_credit_multiplier @@ -88,7 +88,7 @@ for appid in $appids ; do last_value=`$MYSQL --execute="select multiplier from credit_multiplier where appid=$appid and (unix_timestamp(now())-time)=(select min(unix_timestamp(now())-time) from credit_multiplier where appid=$appid)"` last_time=`$MYSQL --execute="select unix_timestamp(now())-time from credit_multiplier where appid=$appid and (unix_timestamp(now())-time)=(select min(unix_timestamp(now())-time) from credit_multiplier where appid=$appid)"` - value=`$MYSQL --execute="select ($last_value*(($DECAY_TIME)-$last_time)+$ratio*$last_time)/($DECAY_TIME)"` + value=`$MYSQL --execute="select ($last_value*((($DECAY_TIME)-$last_time)+$ratio*$last_time))/($DECAY_TIME)"` $MYSQL --execute="insert into credit_multiplier values (0,$appid,unix_timestamp(now()),$value);" done