Difference between revisions of "Bin Smoothing"

From Robowiki
Jump to navigation Jump to search
m (Undo revision 8203 by Nat (Talk) : the same reason as Synapse)
m (Using <syntaxhighlight>.)
Line 9: Line 9:
  
 
=== [[Pugilist]]'s ===
 
=== [[Pugilist]]'s ===
<pre>
+
<syntaxhighlight>
 
     double smoothedVisits(int index) {
 
     double smoothedVisits(int index) {
 
double smoothed = 0;
 
double smoothed = 0;
Line 19: Line 19:
 
return smoothed / Math.pow(distanceToTarget() / bulletVelocity, 1.3);
 
return smoothed / Math.pow(distanceToTarget() / bulletVelocity, 1.3);
 
     }
 
     }
</pre>
+
</syntaxhighlight>
  
 
=== PPP ===
 
=== PPP ===
<pre>
+
<syntaxhighlight>
 
double smoothedVisits(int index) {
 
double smoothedVisits(int index) {
 
     double smoothed = 0;
 
     double smoothed = 0;
Line 34: Line 34:
 
     return smoothed;
 
     return smoothed;
 
}
 
}
</pre>
+
</syntaxhighlight>
 
=== Other ways ===
 
=== Other ways ===
 
<pre>Math.pow(0.5, Math.abs(index - count))</pre>
 
<pre>Math.pow(0.5, Math.abs(index - count))</pre>

Revision as of 10:22, 1 July 2010

This article is a stub. You can help RoboWiki by expanding it.

Bin Smoothing is the process of spreading or normalizing the values stored in a Bin for Wave Surfing or Segmentation. It's not needed for Wave Surfing or Segmentation, but can, in theory, improve performance if done right.

How Bin Smoothing works

Bin Smoothing 'flattens' small spikes within it's Bins.

Bin Smoothing Formulas

If you have your own Bin Smoothing Formula, feel free to post it here.

Pugilist's

    double smoothedVisits(int index) {
	double smoothed = 0;
	int i = 0;
	do {
	    smoothed += (double)visits[i] / Math.sqrt((double)(Math.abs(index - i) + 1.0));
	    i++;
	} while (i < Pugilist.FACTORS);
	return smoothed / Math.pow(distanceToTarget() / bulletVelocity, 1.3);
    }

PPP

double smoothedVisits(int index) {
    double smoothed = 0;
    if (index > 0) {
        smoothed += visits[index - 1] / 2;
    }
    if (index < FACTORS - 1) {
        smoothed += visits[index + 1] / 2;
    }
    smoothed += visits[index];
    return smoothed;
}

Other ways

Math.pow(0.5, Math.abs(index - count))

This does a 50% decrease.

Math.pow(0.1, Math.abs(index - count))

This does a 90% decrease

1.0/(double)(1 + (index - count)*(index - count))

Bots Using Bin Smoothing

(Please post your Bots here if they use Bin Smoothing)