瀏覽代碼

Fix a very silly error that was serious reducing the variance of victim selection.

Rather than starting at 0 and working up to a limit, a counter was...starting at the
limit. This removed a lot of variance!
tags/v1.1.2
Fen Dweller 5 年之前
父節點
當前提交
40aa6c599f
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. +1
    -6
      recursive-macro.js

+ 1
- 6
recursive-macro.js 查看文件

@@ -395,7 +395,7 @@ function fill_area(area, weights, variance=0.15)
var limit = Math.min(max, 100);

var count = 0;
var loopvar = limit;
var loopvar = 0;

// for small amounts, actually do the randomness

@@ -403,11 +403,6 @@ function fill_area(area, weights, variance=0.15)

// if we have nothing at all, it's even better!

if (limit > 0 && result.length == 0) {
++count;
++loopvar;
}

while (loopvar < limit) {
if (loopvar <= clusters[candidate.name] && loopvar == 0 && Math.random() < cluster_chances[candidate.name]) {
++count;


Loading…
取消
儲存