replace member S with more descriptive member named variance
parent
2d2d0769f9
commit
7640332133
|
@ -569,7 +569,7 @@ class MCTSGameTree implements Iterable<MCTSGameTree> {
|
|||
private int evalScore;
|
||||
private int steps;
|
||||
private double sum;
|
||||
private double S;
|
||||
private double variance;
|
||||
String desc;
|
||||
private String[] choicesStr;
|
||||
|
||||
|
@ -720,7 +720,9 @@ class MCTSGameTree implements Iterable<MCTSGameTree> {
|
|||
sum += delta;
|
||||
numSim += 1;
|
||||
final double newMean = sum/numSim;
|
||||
S += (delta - oldMean) * (delta - newMean);
|
||||
// see http://datagenetics.com/blog/november22017/index.html for the derivation
|
||||
final double varianceTimesN = variance * (numSim - 1) + (delta - oldMean) * (delta - newMean);
|
||||
variance = varianceTimesN/numSim;
|
||||
|
||||
//if child has sufficient simulations, backup using robust max instead of average
|
||||
if (child != null && child.getNumSim() > maxChildSim) {
|
||||
|
|
Loading…
Reference in New Issue