We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › New programmer, designing a cellular autonoma
Page Index Toggle Pages: 1
New programmer, designing a cellular autonoma (Read 1728 times)
New programmer, designing a cellular autonoma
Apr 11th, 2009, 10:31pm
 
I'm new to the processing language, and I'm trying to learn it as fast as I can, because it looks like it suits my needs rather well. I'm interested in making technological art, and I'm in the middle of a few projects, hung up on programming.

I am building a large scale, maybe four-five feet in height) piece modeled after a lava lamp, with IO indicators covering it, like pixels. For one of the animations on it's surface I'd naturally like to have a lava lamp type animation running. For several reason's Id like to design a cellular autonoma to govern the motion of the cells (bubbles of lava).

The first reason is that I don't want to program five minutes+ of bubbly animation and, as this is an installation in a gallery, it will be running for quite some time, I'd like for it run for a while without looping.

The second is that I've always had an almost unnatural (it's healthy.. i swear) fascination with self governing bodies. I love the concept of creating a set of rules for a body, and then seeing how it behaves in a society.

The indicators on the surface are either on or off, so colors and such are no problem, and they're about the size of a dime, so there won't be too too many.

So I'm thinking some simple(ish) rules for the cells should be as follows:

1) Each lava cell needs a variable for heat.

2) Getting within the bottom fourth of the display, the lava cells should begin to heat up.

3) Getting within the top fourth does the same, only cools the lava cell.

4) The background cells needs to be graded in it's heat value from the bottom to the top.

5) The lava cells should slowly acclimate to their surrounding cells, be they lava or background.

6) Once two lava cells touch, they should not detach.

7) The higher the heat value for the lava cell, the more drawn it is to the top, the lower, the more it is drawn to the bottom.

8) If the lava cell is the same temperature as the background cells around it, it should be pulled down (for both gravity and to avoid an oddball instance of a static environment).

So, those rules, now that I look at them, are a bit complex. I think if I define the rules in a class, I can just call up a certain number of objects as the lava and let them do their thing.

Unlike a real lava lamp, this automation is running on teh flat surface wrapping the Shape, instead of floating within it, so it's a 2D animation, instead of a 3D.

My hangup is that I'm not too good with converting those rules into math, although that math is exactly what I'm fascinated with.

If anybody has any ideas on how to implement this idea into working code, I'd be thrilled.

Also, after this is all said and done, I need to map the pixel grid to an abnormal shape, each horizontal row will be straight, but the width of each row, for end to end will vary, as I'm essentially wrapping it around a cone, and the diameter varies as it reaches it's vertex.
Re: New programmer, designing a cellular autonoma
Reply #1 - Apr 12th, 2009, 2:33am
 
Your project is interesting, the rules are sound, make sense.
But I fear they won't be trivial to convert to code, even for an experienced programmer...
I will think about it but I can't give any delay nor result! Others might be better than me on this, I hope so.
Re: New programmer, designing a cellular autonoma
Reply #2 - Apr 12th, 2009, 7:11am
 
I would be absolutely enthralled to have someone with more skill in the area of rules (if that's an area) or just processing in general.

What if I were to make each rule one-by-one, starting with the easiest.

The first thing done would be assigning the variable to the lava class for it's heat.

Rules two and three, governing global heat gain and loss, might be next. Would is be possible to assign values to each row on the display for their heat, and make teh lowest one hottest, and the highest ones coolest. To make it work, code would need to be written to allow the lava cells to acclimate their temperature to that of the surrounding cells.

It seems the rule governing how fast they move and in what direction, up or down, would be simple, mapping their temperature to a span from maybe 5 to -5, and have that speed variable determine how fast and in what direction they move. Perhaps the code could go so far as to compare the value of the temperature of the lava cell to that of any background cells touching it, and that comparison could be used to determine the speed value.

The gravity one could just be a negative number added onto the speed variable after it is calculated, to pull down all cells gently.

The final problem, mapping it to an abnormal group of cells, I have an idea of how to implement it, but I don't know if it's even possible. Could I draw out where the cells are, maybe with a simple(ish) voronoi diagram, and have to program run within that environment.

Re: New programmer, designing a cellular autonoma
Reply #3 - May 6th, 2009, 5:51am
 
Just a question:

Have you looked at the Cellular Automata section under learning topics?

http://processing.org/learning/topics/

Also, the fluid example probably looks a lot more like a lava lamp. Perhaps tinking with the example will help

http://processing.org/learning/topics/fluid.html
Page Index Toggle Pages: 1