-
5
pages
-
English
-
Documents
Description
ACMLautomates cellulaire en camlAPI tutorialhow to de ne your favorite ’bistrouillet’in a few lines of camlGuillaume Theyssier | September 15, 2011Before starting...This document is about writting OCaml source code to de ne cellular automata using the ACMLAPI. A reasonable knowledge of both OCaml programming language and cellular automata isassumed.Each section below describes a valid source le to be opened by the application acml. De-pending on the way you obtained acml, there should be somewhere a directory called ’tutorials’containing the source le of each section ( le name section title).It is a good idea to have a look at the API reference each time you discover a new functionname in this tutorial.Contents1 Hello world 12 Parameters 23 Con gurations 24 Arbitrary rules 35 Randomness 41 Hello worldThis example illustrates the very basic way of using the ACML API. It de nes the elementarycellular automaton whose local rule is the sum modulo 2 of the cell itself and its left and rightneighbours (rule 150).An ACml source le is nothing else than a valid OCaml source le using the ACML API.open AcmlThe only thing that ACML will keep from your source at the end is not an Acml object but afunction transforming a given Acml object into a new one. This is the key concept. I repeat: theAPI doesn’t want an object but a function transforming an object into the desired one. So let’sde ne a function!let transform a =1At this point we don’t know ...
-
Publié par
-
Langue
English