mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-16 11:44:50 +02:00
optimization
This commit is contained in:
@@ -61,10 +61,11 @@ function wf_collapse(wf, x, y, weights) =
|
||||
_wf_collapse(wf, x, y, states, weights, len(states), threshold);
|
||||
|
||||
function _wf_collapse(wf, x, y, states, weights, leng, threshold, i = 0) =
|
||||
threshold < 0 || i == leng ? wf :
|
||||
threshold < 0 || i == leng ? wf :
|
||||
let(weight = weights[i])
|
||||
_wf_collapse(
|
||||
threshold < weights[i] ? _replaceStatesAt(wf, x, y, [states[i]]) : wf,
|
||||
x, y, states, weights, leng, threshold - weights[i], i + 1
|
||||
threshold < weight ? _replaceStatesAt(wf, x, y, [states[i]]) : wf,
|
||||
x, y, states, weights, leng, threshold - weight, i + 1
|
||||
);
|
||||
|
||||
// Shannon entropy
|
||||
|
Reference in New Issue
Block a user