@thi.ng/cellular 0.2.44 → 0.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1d.js +5 -6
- package/CHANGELOG.md +7 -1
- package/README.md +2 -1
- package/package.json +9 -9
package/1d.js
CHANGED
|
@@ -212,7 +212,7 @@ export class MultiCA1D {
|
|
|
212
212
|
const [dest, num] = this._getTarget(target);
|
|
213
213
|
const fn = target === "prob" ? () => rnd.float() : () => rnd.int() % num;
|
|
214
214
|
for (let x = 0, width = this.width; x < width; x++) {
|
|
215
|
-
if (rnd.
|
|
215
|
+
if (rnd.probability(prob))
|
|
216
216
|
dest[x] = fn();
|
|
217
217
|
}
|
|
218
218
|
return this;
|
|
@@ -241,10 +241,9 @@ export class MultiCA1D {
|
|
|
241
241
|
const { width, prob, gens, configs, mask } = this;
|
|
242
242
|
const [next, curr] = gens;
|
|
243
243
|
for (let x = 0; x < width; x++) {
|
|
244
|
-
next[x] =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
: curr[x];
|
|
244
|
+
next[x] = rnd.probability(prob[x])
|
|
245
|
+
? this.computeCell(configs[mask[x]], x, curr[x])
|
|
246
|
+
: curr[x];
|
|
248
247
|
}
|
|
249
248
|
gens.unshift(gens.pop());
|
|
250
249
|
}
|
|
@@ -305,7 +304,7 @@ export class MultiCA1D {
|
|
|
305
304
|
const $ = (id, conf) => {
|
|
306
305
|
conf &&
|
|
307
306
|
conf.perturb &&
|
|
308
|
-
rnd.
|
|
307
|
+
rnd.probability(conf.perturb) &&
|
|
309
308
|
this.setNoise(id, conf.density || 0.05, rnd);
|
|
310
309
|
};
|
|
311
310
|
for (let y = 0; y < height; y++) {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-08-
|
|
3
|
+
- **Last updated**: 2023-08-12T13:14:08Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [0.2.47](https://github.com/thi-ng/umbrella/tree/@thi.ng/cellular@0.2.47) (2023-08-12)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update .probability() call sites in various pkgs ([c8c8141](https://github.com/thi-ng/umbrella/commit/c8c8141))
|
|
17
|
+
|
|
12
18
|
## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/cellular@0.2.0) (2022-06-11)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
|
+
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
|
|
2
3
|
|
|
3
|
-
# 
|
|
4
5
|
|
|
5
6
|
[](https://www.npmjs.com/package/@thi.ng/cellular)
|
|
6
7
|

|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/cellular",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.47",
|
|
4
4
|
"description": "Highly customizable 1D cellular automata, shared env, multiple rules, arbitrary sized/shaped neighborhoods, short term memory, cell states etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.9.
|
|
38
|
-
"@thi.ng/checks": "^3.4.
|
|
39
|
-
"@thi.ng/errors": "^2.3.
|
|
40
|
-
"@thi.ng/random": "^3.
|
|
41
|
-
"@thi.ng/transducers": "^8.5.
|
|
37
|
+
"@thi.ng/api": "^8.9.3",
|
|
38
|
+
"@thi.ng/checks": "^3.4.3",
|
|
39
|
+
"@thi.ng/errors": "^2.3.3",
|
|
40
|
+
"@thi.ng/random": "^3.6.0",
|
|
41
|
+
"@thi.ng/transducers": "^8.5.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.36.
|
|
45
|
-
"@thi.ng/testament": "^0.3.
|
|
44
|
+
"@microsoft/api-extractor": "^7.36.4",
|
|
45
|
+
"@thi.ng/testament": "^0.3.21",
|
|
46
46
|
"rimraf": "^5.0.1",
|
|
47
47
|
"tools": "^0.0.1",
|
|
48
48
|
"typedoc": "^0.24.8",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
],
|
|
93
93
|
"year": 2022
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "399f8c53d66b9b763d16c21bb59f145df5f59514\n"
|
|
96
96
|
}
|