@wonderyard/vivarium 1.0.0 → 1.1.0
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/README.md +1 -1
- package/dist/main.d.ts +4 -4
- package/dist/main.js +15 -15
- package/dist/webgpu/setup.d.ts +4 -2
- package/dist/webgpu/setup.js +1419 -1418
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { Helpers } from './blueprint/helpers';
|
|
2
|
+
export { ElementBlueprint, KindBlueprint, RefBlueprint, } from './blueprint/ref-blueprint';
|
|
3
|
+
export { RuleBlueprint, RuleBlueprintWithAccept, } from './blueprint/rule-blueprint';
|
|
4
|
+
export { VivariumBlueprint } from './blueprint/vivarium-blueprint';
|
|
1
5
|
export { vivarium } from './vivarium/vivarium';
|
|
2
6
|
export { setup } from './webgpu/setup';
|
|
3
|
-
export { VivariumBlueprint } from './blueprint/vivarium-blueprint';
|
|
4
|
-
export { RefBlueprint, ElementBlueprint, KindBlueprint, } from './blueprint/ref-blueprint';
|
|
5
|
-
export { RuleBlueprint, RuleBlueprintWithAccept, } from './blueprint/rule-blueprint';
|
|
6
|
-
export { Helpers } from './blueprint/helpers';
|
package/dist/main.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Helpers as t } from "./blueprint/helpers.js";
|
|
2
|
+
import { ElementBlueprint as i, KindBlueprint as o, RefBlueprint as u } from "./blueprint/ref-blueprint.js";
|
|
3
|
+
import { R as m, a as n } from "./rule-blueprint-DGODv9IV.js";
|
|
4
|
+
import { VivariumBlueprint as x } from "./blueprint/vivarium-blueprint.js";
|
|
5
|
+
import { vivarium as a } from "./vivarium/vivarium.js";
|
|
6
|
+
import { setup as R } from "./webgpu/setup.js";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
i as ElementBlueprint,
|
|
9
|
+
t as Helpers,
|
|
10
|
+
o as KindBlueprint,
|
|
11
|
+
u as RefBlueprint,
|
|
12
|
+
m as RuleBlueprint,
|
|
13
|
+
n as RuleBlueprintWithAccept,
|
|
14
|
+
x as VivariumBlueprint,
|
|
15
|
+
R as setup,
|
|
16
|
+
a as vivarium
|
|
17
17
|
};
|
package/dist/webgpu/setup.d.ts
CHANGED
|
@@ -63,16 +63,18 @@ export declare const mainCompute: import('typegpu').TgpuComputeFn<{
|
|
|
63
63
|
}>;
|
|
64
64
|
/**
|
|
65
65
|
* Initializes the WebGPU simulation for a given canvas and automaton. The grid is randomly initialized
|
|
66
|
-
* with the defined elements.
|
|
66
|
+
* with the defined elements unless an `initialGrid` is provided.
|
|
67
67
|
*
|
|
68
68
|
* @param options - An object containing the `canvas` element and the compiled `automaton`.
|
|
69
69
|
* @param options.canvas - The HTML canvas element. Its `width` and `height` define the grid dimensions.
|
|
70
70
|
* @param options.automaton - The compiled automaton produced by {@link VivariumBlueprint.create | vivarium().create()}.
|
|
71
|
+
* @param options.initialGrid - An optional flat array of element indices (one per cell, row-major order) to use instead of random initialization.
|
|
71
72
|
* @returns An object with an `evolve` function that advances the simulation by one step, a `setAutomaton` function to update the automaton, and the underlying `tgpuRoot`.
|
|
72
73
|
*/
|
|
73
|
-
export declare const setup: ({ canvas, automaton, }: {
|
|
74
|
+
export declare const setup: ({ canvas, automaton, initialGrid, }: {
|
|
74
75
|
canvas: HTMLCanvasElement;
|
|
75
76
|
automaton: Automaton;
|
|
77
|
+
initialGrid?: number[];
|
|
76
78
|
}) => {
|
|
77
79
|
evolve: () => Promise<void>;
|
|
78
80
|
setAutomaton: ({ automaton }: {
|