mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 04:51:26 +02:00
refactor: replace states directly
This commit is contained in:
@@ -79,12 +79,10 @@ function _wf_collapse(wf, x, y, states_weights, leng, threshold, i = 0) =
|
|||||||
threshold < 0 || i == leng ? wf :
|
threshold < 0 || i == leng ? wf :
|
||||||
let(state_weight = states_weights[i])
|
let(state_weight = states_weights[i])
|
||||||
_wf_collapse(
|
_wf_collapse(
|
||||||
threshold < state_weight[1] ? _oneStateAt(wf, x, y, state_weight[0]) : wf,
|
threshold < state_weight[1] ? _replaceStatesAt(wf, x, y, [state_weight[0]]) : wf,
|
||||||
x, y, states_weights, leng, threshold - state_weight[1], i + 1
|
x, y, states_weights, leng, threshold - state_weight[1], i + 1
|
||||||
);
|
);
|
||||||
|
|
||||||
function _oneStateAt(wf, x, y, state) = _replaceStatesAt(wf, x, y, [state]);
|
|
||||||
|
|
||||||
// Shannon entropy
|
// Shannon entropy
|
||||||
function wf_entropy(wf, x, y) =
|
function wf_entropy(wf, x, y) =
|
||||||
let(
|
let(
|
||||||
|
Reference in New Issue
Block a user