Snowflake in MGS


The animated picture below visualizes the first evolution steps of a cellular automata on an hexagonal grid. This cellular automaton idealizes the formation of a snowflake (cf. "A new kind of science", S. Wolfram, pp. 369). Black cells represent region of solid and white cells represent regions of liquid or gaz. The molecules in a snowflake lie on a simple hexagonal grid. Whenever a piece of ice is added to the snowflake, a little heat is released which then tends to inhibit the addition of further pieces of ice nearby. The corresponding evolution rule is very simple: a cell becomes black whenever exactly one of its neighbors was black the step before.
It is very simple to define an hexagonal grids in MGS: an hexagonal grids correpond to a GBF (a group indexed data-structure). The underlying group is (a, b, c; a+b=c) and this presentation is directly used in MGS to defines the underlying lattice.

growth of a snowflake in an hexagonal grid using MGS.
a natural crystal of ice

The corresponding MGS program

gbf hexa = <a,b,c;a+b=c> ;;
Definition of a GBF type. GBF means Group Based Fields. A GBF specifies a uniform topology where the element are indexed by a mathematical group. Here, all elements in an instance of the GBF  type hexa have three neighbors: one following the direction a, the other following the direction b and c. (and also three others neighbors reached following the inverse directions).

This is juste the way in MGS to define an hexagonal grid whose axis are named a, b and c.
trans T =
   (0 as x / (neighborsfold((\a,b.a+b), 0, x)==1)
    => 1);;

The transformation consists in only one rule: a 0 is turned into a 1 if there is only one neighbors with state 1.

Back to top
MGS examples index
MGS home page

(currently under construction logo)
this site is under construction.
Pages started: May 2002. Last revision: 24 jully 2003.

Creative Commons License
Pictures, graphics and animations are licensed under a Creative Commons License.

English keywords for indexation: computer science, programming language, topological collections, transformation, declarative programming language, functional languages, simulation of biological processes, cell model, biological pathway, interaction network, gene regulation, signal transduction, morphogenesis, developmental biology, integrative simulation, biological organization, dynamical systems, dynamical structure, Gamma, CHAM, P system, L system, Paun, Lindenmayer, cellular automata, membrane computing, aqueous computing, artificial chemistry, GBF, Cayley graph, data fields, nested collections, rewriting, rule based programming, pattern-matching, intentional programming, compilation, interpretation, type, type inference, nested type, polytypism, catamorphism, static analysis, sequence, multiset, combinatorial algebraic topology, chain complex, chain group.