A world in dk(decay/denmark) » Strange Attractor http://rotand.dk Just another pointless weblog Sat, 30 Nov 2013 21:03:48 +0000 en-US hourly 1 https://wordpress.org/?v=4.3.18 Strange Attractor Wars http://rotand.dk/2008/04/08/strange-attractor-wars/ http://rotand.dk/2008/04/08/strange-attractor-wars/#comments Mon, 07 Apr 2008 22:10:04 +0000 http://rotand.dk/blog/2008/04/08/strange-attractor-wars/ Strange Attractors are quite pretty.

I made have generated quite some random attractors.

Now I need to find the most beautiful ones, and I need your help!

I have created a voting system, where 3 attractors line up and you select the best one. The votes are then accumulated and and overall top 10 is generated.

Strange Attractor wars

It is heavily inspired by kittenwars.com.

I have been hacking away on this far to long. But expect an article with more details on Strange attractors and probably more features in the “war” application. (like top 100, biggest looser, most victorious etc).

Now just go and make some votes :)

]]>
http://rotand.dk/2008/04/08/strange-attractor-wars/feed/ 5
Java life simulator http://rotand.dk/2007/06/01/java-life-simulator/ http://rotand.dk/2007/06/01/java-life-simulator/#comments Fri, 01 Jun 2007 14:31:54 +0000 http://rotand.dk/blog/2007/06/01/java-life-simulator/ Having played a bit with cellular automata’s – and looking at various other rulesets. I started to wonder what the result would be if every cell had i different ruleset, or just different types of cells interacting.

And what if there were mutations and sexes involved ?

Well getting ideas like that are dangerous, they usually result in some kind of coding project. And well this time I felt the urge to implement some features. Instead of continuing to try to write in c++ with CImg or SDL, which is kinda of new to me. I went back to java. Mainly because I’m more experienced with java and I have some code that I can reuse from earlier projects ( a flamefractal render and a small framework for rendering strange attractors ).

So I started hacking away making nice features and building a framework for experiments. Where there are generic cells and loose coupling using interfaces.

A cell just needs to implement :

  • a constructor taking its coordinates, and the map it belongs to as arguments
  • a isAlive()
  • boolean iterate () which gets it neighbors from the map and decides wheter it should be dead or alive in the next round
  • nextState() instead of using buffers I decided to have a method in a cell that changes it state, and as a ugly temporary hack at the same time returns value to determine its color

Of course in order to apply more interesting rules I need them to have a type, and they should be able to decide their fate based upon their neighbors types. And I still need to figure out a way to implement some kind of generic ruleset, if/when I need a way to mutate.

All the cells are placed in a double array (cells[][] ) and there’s a CellMap – class keeping track of them. I tried optimizing by only looking a cells that are alive, and their neighbors – instead of looking at every cell in each iteration. I used a MVC pattern so the map runs in its own thread and after each iteration it calls the gui to be painted. Its quite fast at iterating, but the painting process takes forever. Alas, the next step is to use a buffered image to speed op the rendering process, or …

After all these fancy designpatterns, threading all it does at the moment is a simple “life-like” cellular automata, but Its made for extending. And It has nice coloring., in earlier experiments i have made a generic gradient class, which came in very handy.

By the way please take a look at my online collection of random strange attractors

]]>
http://rotand.dk/2007/06/01/java-life-simulator/feed/ 0