[Home]AndrewsCoolWay

Robo Home | Changes | Preferences | AllPages

A way to deal with VisitCountStats with both some data decay and some BinSmoothing. Introduced by Andrew (aka Frakir). Here's a typical implementation:
    void registerVisitsAndrewsCoolWay(double[] buffer, int index) {
	for (int i = 1; i < FACTORS; i++) {
	    buffer[i] *= 0.98;
	}
	buffer[index] += 0.01;
	if (index + 1 < FACTORS) {
	    buffer[index + 1] += 0.006;
	}
	if (index - 1 > 0) {
	    buffer[index - 1] += 0.006;
	}
    }
(from CassiusClay's gun)

-- PEZ


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited July 31, 2004 17:27 EST by PEZ (diff)
Search: