Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating state is not really done "correctly" #18

Open
pstray opened this issue Aug 30, 2022 · 5 comments
Open

Updating state is not really done "correctly" #18

pstray opened this issue Aug 30, 2022 · 5 comments

Comments

@pstray
Copy link

pstray commented Aug 30, 2022

As all the rules modify state, later rules are influenced by the effects of earlier rules... if this should be a "correct" simulation, all forces had to be calculated first, then applied to to the state. But the simulation is much more interesting with this bug ;)

@pstray pstray changed the title Updating state is not really "correct" Updating state is not really done "correctly" Aug 30, 2022
@hunar4321
Copy link
Owner

The modified Javascript file fixes that. I may modify the C++too but this might change the parameter settings to different numbers in order to reproduce similar patterns. For now, I'll leave it like that.

@pstray
Copy link
Author

pstray commented Aug 30, 2022

Yes, not even sure you can get the same results if you make the simulation "correct"

@dangarfield
Copy link
Contributor

One other point to note is that the fx fy values are also iteratively updated, which means that if you were going to fully GPU parallelise the fx fy calculations, it wouldn't be possible in the current method as the earlier atom x, y positions are updated. If you fully calculate the fx fy values in parallel before applying any values to any given atom x y, it just doesn't look very good. I experimented with this using gpu.js and whilst it works (using matrices rather than objects), nothing looks anything as interesting as when the updates are applied progressively.

You can, of course, apply parallelism to each individual atom, but there is no real performance benefit, in fact it is worse than using the basic matrices.

@IRobot1
Copy link

IRobot1 commented Sep 11, 2022

Great minds thing alike.
A 3D version was also implemented here.
The VR experience really makes a difference

@hunar4321
Copy link
Owner

Great minds thing alike. A 3D version was also implemented here. The VR experience really makes a difference

I don't have VR but I imagine interacting with the particles with attraction/repulsion gestures can be so fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants