Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Advection Swarm Chemistry with ActionScript Workers and the Feathers UI

DZone's Guide to

Advection Swarm Chemistry with ActionScript Workers and the Feathers UI

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software


Here's an extension to my recent implementation of Hiroki Sayama's Swarm Chemistry. I've plugged in a fluid dynamics solver (a worker used in my Reaction Diffusion Advection experiment) so that particles (swarm members) radiate heat and add to the CFD density field which then feeds back velocities to the swarm chemistry model.

The swarm genomes now have two new properties:


  • Temperature defines how much heat individual swarm members radiate (in this CFD implementation, temperature and density are synonymous).
  • Advectability defines how much individual swarm members are affected by the CFD velocity field. At zero, the swarm members aren't affected at all and at negative values, members accelerate in the opposite direction to the CFD velocity.


There's (obviously) a lot more movement with the advection buffeting the particles around, as you can see in this video:


Again, I've used ActionScript Workers to run several tasks simultaneously: there's one to solve the swarm chemistry model, one to solve the fluid dynamics and another to render the image. At any one time all three are running while the UI remains completely responsive.

The new application lives here and the source code is available here.

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Published at DZone with permission of Simon Gladman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}