[CA Terrains] - A New Kind of Science: The NKS ForumA New Kind of Science: The NKS Forum
Pages:1
CA Terrains
(Click here to view the original thread with full colors/images)
Posted by: Jason Cawley
I am reposting this in its own thread within "applied", since it is more relevant here. The subject first came up in a different thread started in the pure NKS section. The original question was about getting larger ranges of values from CA data, to fit cases in the real world that fall into more than a few bins. Here those are height values for a 3D landscape.
We have a general way of getting larger spaces of outcomes from small sets of discrete elements. We treat the discrete bits as first differences of some running total, and then put lots of them together. A random walk takes coin flips and adds them up into a price series, for example. The overall prices are not limited to plus or minus 1. We can do the same thing with CAs.
I've attached a notebook that shows how to generate sample artificial terrain surfaces with 2D CAs. I used 3 color nearest neighbor totalistic rules, a space that gives over a billion possible rules and fits naturally with the purpose. Then the idea is, you treat a number of steps of the CA evolution as a lot of local values, through the time dimension. Now treat those as your first differences and add them up. So a local CA value of 2 on a given step means "increment the local value by 1". A local value of 0 means "reduce the local value by 1", and a CA value of 1 means "remain unchanged on that step".
Last we can decide whether to smooth the results a bit or not. A built in function for that is ListConvolve, which basically averages out the value at each location, according to some specified weighting of its neighbors (called the kernel). I use a function I wrote called "smooth" which can be given arguments of 0 - do nothing, 1, ListConvolve once, or 2 - ListConvolve 4 times in nested fashion.
You can display the results in 3 different ways - as a ListPlot3D plot or a ListContourPlot, or the raw data via MatrixForm[Round[#]]&. I also provide a sample of initial conditions, the first bunch from a single seed of 1 or 2 value in a field of 0s, then a few 1s or a few 2s or some of each mixed, and the last half random initials.
As you try different rule numbers, initials, steps, and smoothing choices, you get a whole variety of sample terrains. Not at all restricted to +1, 0, or -1 height, and without ever using more than 3 colors.
I hope this is interesting.
Forum Sponsored by Wolfram Research
© 2004-2008 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. |
Disclaimer
vB Easy Archive Final - Created by Xenon and modified/released by SkuZZy from the Job Openings