Improved the high and low count statistics by only including the last
high and low from 60 seconds ago.
This commit is contained in:
parent
392e89a724
commit
6fb872b5ee
Binary file not shown.
@ -25,7 +25,7 @@ public enum ItemSet {
|
||||
ALIKAHN(3,1, 15,6, 30,10, 1,1),
|
||||
LORASAADI(4,1, 4,2, 8,6, 8,3),
|
||||
MOONSHADOW(4,2, 1,1, 8,8, 15,7),
|
||||
GLADOMAIN(1,1, 12,10, 8,8, 1,1),
|
||||
GLADOMAIN(1,1, 12,4, 8,4, 1,1),
|
||||
WOLFSBANE(2,1, 15,10, 10,5, 15,10),
|
||||
ALUSTINE(3,2, 300,-30, 50,-5, 6,2),
|
||||
DASHER(5,5, 3,3, 5,5, 0,0),
|
||||
|
@ -7,6 +7,8 @@ public class Average {
|
||||
int low;
|
||||
int trend;
|
||||
int last;
|
||||
int lasthigh;
|
||||
int lastlow;
|
||||
public Average() {
|
||||
this.avg=0;
|
||||
this.count=0;
|
||||
@ -17,11 +19,15 @@ public class Average {
|
||||
}
|
||||
|
||||
public void add(int value) {
|
||||
if (lasthigh>60) {high=0;lasthigh=0;}
|
||||
if (lastlow>60) {low=Integer.MAX_VALUE;lastlow=0;}
|
||||
if (value>high) {
|
||||
high=value;
|
||||
lasthigh=0;
|
||||
} else
|
||||
if (value<low) {
|
||||
low=value;
|
||||
lastlow=0;
|
||||
}
|
||||
last=value;
|
||||
int curravg = avg;
|
||||
@ -29,6 +35,8 @@ public class Average {
|
||||
trend += Math.signum(avg-curravg);
|
||||
if (trend>60) {trend=60;}
|
||||
if (trend<-60) {trend=-60;}
|
||||
lasthigh++;
|
||||
lastlow++;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user