 |
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Sep 14, 2005 8:42 am
Average bug finding help |
Ok, i'm getting sick of this screwing my average time up, can anyone see the bug, its prolly staring me in the face
In the Complete Trigger
Code: |
#var alluran/timers/campaign/camp_finish %secs
#var alluran/timers/campaign/camp_average_time %eval( (@alluran/timers/campaign/camp_average_time*@alluran/timers/campaign/camp_average_count+(@alluran/timers/campaign/camp_finish-@alluran/timers/campaign/camp_start))/(@alluran/timers/campaign/camp_average_count+1))
#add alluran/timers/campaign/camp_average_count 1
|
In the Begin Trigger
Code: |
#var alluran/timers/campaign/camp_start %secs
|
|
|
_________________ The Drake Forestseer |
|
|
 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Wed Sep 14, 2005 10:28 am |
my math sucks... but shouldnt it look something like:
Code: |
finish = %secs
#ADD avg_count 1
avg_time = %eval(((@avg_time+(@finish-@start)))/@avg_count)
|
calculate finish - start, add it to the average time, then divide it by the count? |
|
|
 |
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Sep 14, 2005 10:33 am |
Wouldnt that create weighted averages?
ie
campaign 1 = 10 minutes average 10 minutes
campaign 2 = 00 minutes average 05 minutes
campaign 3 = 00 minutes average 1.6 minutes
whilst the REAL average on the 3rd SHOULD be 3.33 minutes |
|
_________________ The Drake Forestseer |
|
|
 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Wed Sep 14, 2005 11:33 am |
avg=0
finish=600
start=0
count=1
#SHOW %eval((0+(600-0))/1) ---> 600
-->600secs = 10min
avg=600
finish=0
start=0
count=2
#SHOW %eval((600+(0-0))/2) ---> 300
--> 300secs/5min
avg=600
finish=0
start=0
count=3
#SHOW %eval((600+(0-0))/3) ---> 200
--> 200secs/3min 20secs(3.3min) |
|
|
 |
|
|