Newsgroups: comp.ai.genetic,comp.ai.alife,comp.ai.neural-nets
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!yeshua.marcam.com!uunet!utcsri!cdf.toronto.edu!g2kafka
From: g2kafka@cdf.toronto.edu (Patrick Tierney)
Subject: Re: Make a BattleMech Stand Up!
Message-ID: <CyAMB8.Ft7@cdf.toronto.edu>
Sender: news@cdf.toronto.edu (Usenet News)
Nntp-Posting-Host: eddie
Organization: University of Toronto, Computing Disciplines Facility
References: <none> <37ujg7$du1@aiken.csee.usf.edu> <38hd0rINNg0j@early-bird.think.com> <38jimc$crr@bones.intellicorp.com>
Date: Wed, 26 Oct 1994 18:35:30 GMT
Lines: 60
Xref: glinda.oz.cs.cmu.edu comp.ai.genetic:4103 comp.ai.alife:1189 comp.ai.neural-nets:19680

In article <38jimc$crr@bones.intellicorp.com>,
Richard Treitel <treitel@intellicorp.com> wrote:
>
>Thanks for the pointers to SIGGRAPH etc.; since I no longer am at a
>university, it may take me some time to follow these up.  Meanwhile,
>if you have the time, I'd be interested in a brief description of how
>the Lisp functions were generated and applied to the plane (for
>example, did they just take X and Y as arguments, or were there
>more?).  A description at about the level of detail of the one given
[deletion]

Basically, a lisp function call is either an atom or list of k elements.
If an atom, it's either a number (constant) or a variable (X or Y). If
a list, the first element is a function name, the remaining k-1 arguments
are function calls. So to create a random function F, you could create an
association list of function names with their arity (k-1). Then assign
random probabilities to the 4 events:
	1. F is a function from the list
	2. F is a constant
	3. F is variable X
	4. F is variable Y
If you choose 2 3 or 4, you're done. If 1, then you recursively create
the k-1 functions Fsub1,...,Fsub(k-1) to fill in the arguments.
You pick actual functions from your a-list randomly. Same thing for
constants.

From my understanding, you only need variables X and Y. Suitable
atomic functions might be sin, cos, atan, mod, abs, *, +, -, /, etc,
as well as random number generators, noise generators, filters. Sims
also mentions using an ifs fractal generator.

Having constructed a bunch of these functions, you map them onto the
XY plane, where the output at (X0,Y0) is the color of the pixel at that
point. Selection is just some mapping from your preferences to the
probability that a given function survives to the next generation.

Mating can be done by picking arbitrary nodes in the function description
for two functions (understood as a tree), and swapping at that point.

ie F=(+ X (* 3.14 (cos (+ Y (abs X))))) and G = (* (+ X (random Y)) (atan Y)))
might become H1= (+ X (* (atan Y) (cos (+ Y (abs X)))))
and          H2= (* (+ X (random Y)) 3.14))

Mutation can take several forms. First you might replace a given node
in the function-tree (and its subtree) with a randomly generated function
as above. Or you might change an atomic function to another one, perturb
a constant, make the tree deeper by turning a node into an argument to
another function (ie (+ (* 3.14 X) Y) becomes (sin (+ (* 3.14 X) Y)),
or make the tree less deep by replacing a function by just one of its
arguments.

That's about it, but you really owe yourself a glance at Sims ALife 2(??)
paper that describes all this. He presents several other ideas, including
the use of similar techniques with 3d object descriptions.

Hope this helps, and let me know if you have any questions about the above.

Patrick Tierney
g2kafka@cdf.toronto.edu

