Wednesday, August 4, 2010

Evolving Intelligence

This article at New Scientist reviews some new developments in artificial life using a software package called Avida to evolve memory in simulated organisms.

"The big question is: how did we get here? Our intelligence didn't evolve all at once," says Pennock. "You need certain ingredients. Memory is one."
Experiments in Avida nearly always start with the simplest possible organisms, ones that can only clone themselves. To make them evolve, the experimenters release them into a competitive environment where the prize is an amount of "food" - aka processing time - which allows organisms to produce more clones.

Tuesday, June 29, 2010

Swarm Generated Music

Black Allegheny is one of the first albums made up entirely of swarm generated music. The album was created using a swarm-controlled sampler called Becoming, which was programmed by the composer.


Swarm Controlled Sampler - Becoming Live from Evan Merz on Vimeo.

Becoming is an algorithmic composition program written in java, that builds upon some of John Cage’s frequently employed compositional processes. Cage often used the idea of a “gamut” in his compositions. A gamut could be a collection of musical fragments, or a collection of sounds, or a collection of instruments. Often, he would arrange the gamut visually on a graph, then use that graph to piece together the final output of a piece. Early in his career, he often used a set of rules or equations to determine how the output would relate to the graph. Around 1949, during the composition of the piano concerto, he began using chance to decide how music would be assembled from the graph and gamut.
In Becoming, I directly borrow Cage’s gamut and graph concepts; however, the software assembles music using concepts from the AI subfield of swarm intelligence. I place a number of agents on the graph and, rather than dictating their motions from a top-down rule-based approach, the music grows in a bottom-up fashion based on local decisions made by each agent. Each agent has preferences that determine their movement around the graph. These values dictate how likely the agent is to move toward food, how likely the agent is to move toward the swarm, and how likely the performer is to avoid the predator.

For more information, checkout Evan's article on the Computer Music Blog.

Thursday, June 24, 2010

Using the Equals Symbol for Assignment is Evil

As experienced programmers, we take many things for granted. One example is that no one who is experienced thinks twice about using "=" as the assignment operator. However, I've found that students with absolutely no programming experience have a great deal of difficulty understanding the semantics of assignment. They confuse the assignment operator with "=" as used in a math context. After all, it's the same symbol, isn't it? And, of course, many of the students think that if it's the same symbol as used in math then it must be commutative, right? x = y means the same as y = x in math therefore variable1 = variable2 must be the same as variable2 = variable1, correct? Do you see where I'm coming from?

I try to get around this problem by introducing the concept of assignment using the operator "<-". It does seem to help but only marginally. Once you get into real programming, students have to face the issue and for some it is still just terribly confusing. We use Python at UAT for our introductory language. A major reason was that Python has one of the simplest syntaxes of any programming language. We've tried Java and C++ but major roadblocks are curly braces and semi-colons. I just wish I could get a Python implementation that uses "<-" for assignment instead of "="!