Permalink
Browse files

docs, demo

  • Loading branch information...
1 parent 4c7d475 commit 5654eb97bf05ae27f35e455613eaea443cc02726 @tranma committed Nov 12, 2012
Showing with 56 additions and 1 deletion.
  1. +2 −0 Main.hs
  2. +27 −0 README.md
  3. +1 −1 World.hs
  4. +26 −0 falling-turnip.cabal
View
@@ -8,8 +8,10 @@ import qualified Data.Array.Repa.Repr.Vector as R
import Graphics.Gloss
import Graphics.Gloss.Raster.Array
import Graphics.Gloss.Interface.Pure.Game
+
-- JuicyPixels-repa
import qualified Codec.Picture.Repa as J
+
-- base
import Control.Monad
import System.Random
View
@@ -1,5 +1,7 @@
Falling Turnip is an interactive particle simulation. Like others in the same genre (typically dubbed "falling sand games"), it has some degree of approximation for gravity, fluid flow and alchemical reactions. Unlike the others, it is based entirely on cellular automata and runs in parallel.
+A short demo video is available [here](http://youtu.be/hlL9yi2hGx0).
+
In our simulation, each pixel is a cellular automation and all physical reactions are phrased as cellular automata rules. This approach enables us to take advantage of the massively distributed/parallel nature of cellular automata, however expressing gravity and fluid behaviour as automata rules has proven challenging.
Background
@@ -43,6 +45,31 @@ The novelty of our simulation lies with the use of cellular automata --- a highl
This project also serves as a testament to the effectiveness of data parallelism in general and the Repa library in particular. Adding more processing cores improves performance without any added effort on the part of the programmer.
+
+Notes
+=====
+
+Assuming you have GHC and cabal installed (if not, get the Haskell platform [here](http://www.haskell.org/platform/)), to build `falling-turnip` simply go `cabal configure && cabal build`. Alternatively, use `make`:
+
+ cabal update
+ cabal install gloss
+ cabal install gloss-raster
+ cabal install repa-3.2
+ cabal install vector
+ cabal install random
+ cabal install JuicyPixels-repa
+ make
+
+Use the following run-time options for optimal performance:
+
+ +RTS -N<number of cores> -qa -qg
+
+For example:
+
+ ./Main +RTS -N7 -qa -qg
+
+The name "Falling Turnip" comes from Repa, which stands for Regular Parallel Arrays, and also means "turnip" in Russian.
+
Bibliography
============
[1] J. L. Schiff, Cellular Automata: A Discrete View of the World (Wiley Series in Discrete Mathematics and Optimization).
View
@@ -1,4 +1,4 @@
-{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE ViewPatterns, PatternGuards #-}
module World
( Element (..), Cell (..)
, Env (..)
View
@@ -0,0 +1,26 @@
+Name: falling-turnip
+Version: 0.1
+Author: Tran Ma
+Maintainer: tranm@cse.unsw.edu.au
+Build-Type: Simple
+Cabal-Version: >=1.6
+Description:
+ Falling sand game/cellular automata simulation using regular parallel arrays.
+
+Tested-with: GHC == 7.4.1
+
+Executable falling-turnip
+ Main-is: Main.hs
+
+ Build-depends:
+ base == 4.*,
+ gloss == 1.7.*,
+ gloss-raster == 1.7.7.*,
+ repa == 3.2.*,
+ repa-algorithms == 3.2.*,
+ vector == 0.9.*,
+ random == 1.*,
+ JuicyPixels-repa == 0.6.1
+
+ ghc-options:
+ -threaded -O3 -Odph -rtsopts -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -fllvm -optlo-O3 -with-rtsopts=-N -with-rtsopts=-qa -with-rtsopts=-qg

0 comments on commit 5654eb9

Please sign in to comment.