<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A world in dk(decay/denmark) &#187; conway</title>
	<atom:link href="http://rotand.dk/blog/tag/conway/feed/" rel="self" type="application/rss+xml" />
	<link>http://rotand.dk/blog</link>
	<description>Just another pointless weblog</description>
	<lastBuildDate>Sat, 27 Jun 2009 19:17:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cellular Automata II</title>
		<link>http://rotand.dk/blog/2007/05/30/cellular-automata-ii/</link>
		<comments>http://rotand.dk/blog/2007/05/30/cellular-automata-ii/#comments</comments>
		<pubDate>Wed, 30 May 2007 20:46:28 +0000</pubDate>
		<dc:creator>jacob</dc:creator>
				<category><![CDATA[Automata]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[automaton]]></category>
		<category><![CDATA[Automatons]]></category>
		<category><![CDATA[cellular automaton]]></category>
		<category><![CDATA[CIimg]]></category>
		<category><![CDATA[cimg]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conway]]></category>
		<category><![CDATA[EvoCell]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[game of life]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Moore Neighborhood]]></category>
		<category><![CDATA[neighborhood]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rotand.dk/blog/2007/05/30/cellular-automata-ii/</guid>
		<description><![CDATA[As mentioned before I&#8217;ve made a one dimensional Cellular Automata(CA). And although it was intriguing they quickly became very predictive. Actually it was in two dimensions. As the a y-coordinate represented time, but since the states were only depending an the adjacent neighbor&#8217;s to the right or left its considered to be one-dimensional.
But they are [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned <a title="Cellular Automata" href="http://rotand.dk/blog/2007/05/29/cellular-automata/">before</a> I&#8217;ve made a one dimensional Cellular Automata(CA). And although it was intriguing they quickly became very predictive. Actually it was in two dimensions. As the a y-coordinate represented time, but since the states were only depending an the adjacent neighbor&#8217;s to the right or left its considered to be one-dimensional.</p>
<p>But they are not as fascinating as CA&#8217;s where you expand the neighborhood to include all the eight adjacent cells. That&#8217;s called the Moore Neighborhood.</p>
<p>Representing the time dimension. As the intersting part is the evolution of the system, representing time is essential. With a two-dimensional CA it has to be done using animations,  and who doesn&#8217;t like blinking pixels. This makes CA&#8217;s makes even more fun.<span id="more-25"></span></p>
<p>In order to decide the state of a cell I look at the Moore neighborhood for every cell on the grid, and count how many neighboring cells are alive. If a cell is alive, then we have to determine whether it survives or dies. If a cell is dead / empty there is the posibility of birth. By defining how many neighbors a cell has to have to survive, and hov many it takes to &#8220;give birth&#8221; it is possible to run the automata. And this is enough to define a highly complex behavior.</p>
<p>The ubiquitous <a title="Life" href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway&#8217;s game of life</a> survives if there are 2 or 3 neighbor&#8217;s alive and a cell is born if 2 cells are alive, this can be written as : S/B = 23/2. Using a notation like this makes it easy to try out new rules, just adjusting the S/B sets.</p>
<p>I made a small c++ program again using CImg to render these automatons. It&#8217;s a rather quick hack, and as such there are plenty off room for optimizing.</p>
<p>But for now it does its job and I don&#8217;t intend to develop it further, at least for now. And I think that CIimg might not be the best api for this, I need to look into SDL.</p>
<p>I spent way too much time hacking around to get a nice coloring scheme, and well CImgs intended users are making image manipulation, and not generating images from scratch.  SDL is&#8217;t intended to generate images from scratch either, but as far as i can tell its easier to manipulate images as int arrays.</p>
<p>Well it does work and i were able to try out some of the rules listed at Wikipedia article about <a title="Life like cellular automatons" href="http://en.wikipedia.org/wiki/Life-like_cellular_automaton">Life like cellular automatons</a>, there online java simulators somewhere on the Internets so I won&#8217;t bother to upload any videos &#8211; as its much more fun to watch in action an play about with the settings as you go along. If you want to play with the code, well here it is : <a title="Cellular Automaton code" href="http://www.rotand.dk/blog/wp-content/ca.txt">Cellular Automaton code</a> it&#8217;s ugly and you need  CImg.h</p>
<p>And  now I&#8217;ve just downloaded <a title="EvoCell" href="http://kybkreis.org/wiki/EvoCell">EvoCell</a> which has all the features and a lot more.</p>
<p>Online simulator : <a href="http://psoup.math.wisc.edu/mcell/mjcell/mjcell.html">MJcell</a> this is a very good implementation. Its fast and has lots of rules and patterns</p>
]]></content:encoded>
			<wfw:commentRss>http://rotand.dk/blog/2007/05/30/cellular-automata-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
