Altered calculate_credit_multiplier to make multiplier calculation more stable.

svn path=/trunk/boinc/; revision=15701
This commit is contained in:
Eric J. Korpela 2008-07-28 22:49:27 +00:00
parent 80bde8a4c6
commit c686684c60
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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