Working but slow
This commit is contained in:
@@ -188,6 +188,35 @@ describe('CA engine runtimes', () => {
|
||||
expect(stepped.cells).toEqual(cells(5, 5, [[0, 2]]))
|
||||
})
|
||||
|
||||
it('uses simulation rng_seed to choose deterministic Naga heads', () => {
|
||||
const current = cells(6, 6)
|
||||
const baseParams = {
|
||||
caClass: { dimensions: 3, states: 7 },
|
||||
renderer: { id: 'voxel-3d' },
|
||||
simulation: {
|
||||
engineId: 'naga-3d',
|
||||
ruleId: 'naga-3d',
|
||||
grid: { size: [6, 6, 6], boundary: 'wrap' },
|
||||
initialCondition: {
|
||||
type: 'cells',
|
||||
cells: [[1, 2, 2, 1], [4, 2, 2, 1]]
|
||||
}
|
||||
}
|
||||
} satisfies SceneParams
|
||||
|
||||
const leftSeed = stepCaSimulation(current, settings({
|
||||
...baseParams,
|
||||
simulation: { ...baseParams.simulation, rng_seed: 'bar' }
|
||||
}))
|
||||
const rightSeed = stepCaSimulation(current, settings({
|
||||
...baseParams,
|
||||
simulation: { ...baseParams.simulation, rng_seed: 'alpha' }
|
||||
}))
|
||||
|
||||
expect(leftSeed.settings.simulation?.initialCondition?.cells).toEqual([[4, 2, 2, 1], [0, 2, 2, 1]])
|
||||
expect(rightSeed.settings.simulation?.initialCondition?.cells).toEqual([[1, 2, 2, 1], [3, 2, 2, 1]])
|
||||
})
|
||||
|
||||
it('keeps Naga 3D sparse coordinates in place when fixed boundaries would leave the grid', () => {
|
||||
const current = cells(5, 5)
|
||||
const params = settings({
|
||||
|
||||
Reference in New Issue
Block a user