mirror of https://github.com/BOINC/boinc.git
Altered calculate_credit_multiplier to make multiplier calculation more stable.
svn path=/trunk/boinc/; revision=15701
This commit is contained in:
parent
80bde8a4c6
commit
c686684c60
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue