Elsevier

Biosystems

Volume 111, Issue 2, February 2013, Pages 111-119
Biosystems

Research article
Evolving an ecology of mathematical expressions with grammatical evolution

https://doi.org/10.1016/j.biosystems.2012.12.004Get rights and content

Abstract

This paper describes the use of grammatical evolution to obtain an ecology of artificial beings associated with mathematical functions, whose fitness is also defined mathematically. The system allows “parasite” species and “parasites of parasites” to develop, and supports the simultaneous evolution of several ecological niches. The use of standard measurements makes it possible to explore the influence of the number of niches or the presence of parasites on “biological” diversity and similar functions. Our results suggest that some of the features of biological evolution depend more on the genetic substrate and natural selection than on the actual phenotypic expression of that substrate.

Introduction

Ecological simulation has a long history. Ever since Vito Volterra developed his famous predator–prey equations (Volterra, 1931) continuous simulation has been used to represent artificial ecological systems (Alfonseca et al., 1998). Discrete simulation has also been used frequently, using such tools as cellular automata and Lindenmayer systems (Alfonseca et al., 2003). Agent-based artificial life ecosystems are relatively old (Conrad and Pattee, 1970) and have fused with artificial life research since the end of the 1980s (see Dorin et al., 2008, for a relatively recent survey of the field). Typical recent simulations in this field tend to define predator–prey systems and complicate the agents by embodying them with fuzzy cognitive maps and similar constructs (Gras et al., 2009).

In biological evolution, a genetic substrate, embodied in nucleic acids, is subject to a certain number of random actions (mutation, recombination, etc.). The different genetic compositions are not selected directly. They are translated into phenotypes whose mutual interaction gives rise to natural selection. Our hypothesis is that many of the features of biological evolution depend more on the genetic substrate and the mechanism of natural selection than on the actual phenotypic expression of that substrate.

This paper describes our experiments to build an evolving ecology of artificial beings which compete for a limited resource environment. The underlying genetic structure is not too dissimilar to that of biological beings (a series of codons, represented as integers), but its phenotypic expression is completely different. In our artificial ecologies, the genomes are subject to genetic algorithms similar to those in biology. Grammatical evolution (GE) is then used to generate, from the genetic substrate, phenotypic counterparts completely different from living beings (a set of simple mathematical expressions). Natural selection is then applied to these phenotypes, after computing mathematically the fitness of the different individuals. Some of the typical features of biological evolution have been reproduced successfully in this simplified environment. Other features we have found could provide new ideas about biological evolution.

Grammatical evolution, a standard technique in genetic programming (see O’Neill and Ryan, 2003, Dempsey et al., 2009, Byrne et al., 2010), suggested itself as the proper method, since it separates genomes from phenotypes and improves the closure problem (the need to eliminate individuals with invalid phenotypes), by protecting phenotypes against syntactic errors. Extensions to grammatical evolution, such as attribute grammatical evolution or Christiansen grammatical evolution (de la Cruz et al., 2005, Ortega et al., 2007) can also protect from semantic errors. We did not need to use those extensions, because our individuals are protected from semantic errors in a different way (see below).

Our agents are very simple, as they only embody a mathematical expression, which is executed to compare their respective fitness. Besides normal individuals, we have also introduced a second kind of agents, the parasites, whose phenotype function invokes the phenotype function of a different individual (and thus copies its fitness). The environment is also very simple: agents do not have a spatial location, although they can belong to one of several ecological niches, which evolve simultaneously, but independently. In biology, an ecological niche is a section of a population that has its own way of living and evolves relatively independently from those in other niches. We represent niches by applying different fitness functions to those individuals belonging to each niche.

Both the expressions and the grammatical evolution environment are written in the APL2 language (Alfonseca and Selby, 1989), which has been selected as the language of choice for the following reasons:

  • APL2 is a very powerful language, especially for the generation of expressions, with a large number of primitive functions and operators available.

  • The APL2 expression grammar is very simple and can be implemented with just four non-terminal symbols, which makes the grammatical evolution process simpler.

  • APL2 instructions can be protected to prevent semantic and execution errors giving rise to program failures. In this way, we can rest assured that all the programs in the benchmark will execute (although their results may not be a good answer to the assignment). The grammatical evolution technique also becomes simpler thanks to this feature, because it is not necessary to include any semantic information.

  • Being an interpretive language, APL2 makes it possible to create programming functions at execution time, thus providing the feasibility of computing fitness during the execution of the genetic algorithm. With a compiling language such as C, this would be very difficult.

This paper is divided in the following way: Section 2 describes our procedure (grammatical evolution and the generation of mathematical expression phenotypes from a genome). Section 3 describes our experiments, and explains three of them in more detail. Section 4 shows the results of those three experiments, followed by a global analysis of the results of all the 200 experiments we have performed. Finally, Section 5 discusses and summarizes our conclusions and lists our future work objectives.

Section snippets

Grammatical evolution (GE)

GE is an Evolutionary Automatic Programming (EAP) algorithm based on strings, independent of the language used. Genotypes are represented by strings of integers (each of which is named codon) and the context-free grammar of the target programming language is used to deterministically map each genotype into a syntactically correct phenotype (a program). In this way, GE avoids one of the main difficulties in EAP: the results of genetic operators are guaranteed to be syntactically correct, while

Simulation experiments

In our experiments, we first define the following parameters:

  • The initial and maximum sizes of the population.

  • The number of ecological niches.

  • Interbreeding between different niches allowed or not (applicable only if more than one niche).

  • The set of values used as arguments for the phenotype functions. In all our experiments this was a vector of integers from 1 to 10.

  • The fitness function(s).

  • The random seed.

Each of the experiments we performed were repeated 10–30 times, with different values for

Results

Table 2 shows some of the dominant functions (those which reached the maximum fitness) during the evolution of the ecology simulated in our first detailed experiment.

This ecology endured for 305 generations, then disappeared (the size of its population became zero). Fig. 1 shows the total size of the population as a function of the generation number, as well as the total number of parasite individuals. Fig. 2 displays the evolution of the normal individuals and the parasites. It is easy to see

Conclusions

In this paper we have designed a procedure that generates artificial ecologies that exhibit some of the features of natural evolution, among them the following:

  • The appearance of parasite species. Parasites of parasites also happen.

  • A Volterra-like relationship between parasites and hosts.

  • Different numbers of niches are supported, with and without interbreeding. Average diversity increases with the number of niches.

  • When a niche becomes empty, it can be colonized by the offspring of a different

References (18)

  • M. Conrad et al.

    Evolution Experiments with an artificial ecosystem

    J. Theor. Biol.

    (1970)
  • M. Alfonseca et al.

    APL2 and PS/2: the language, the systems, the peripherals

    APL Quote Quad (ACM SIGAPL)

    (1989)
  • M. Alfonseca et al.

    Education in ecology at the internet with an object-oriented simulation language

  • M. Alfonseca et al.

    Cellular automata and probabilistic L systems: an example in ecology

  • J. Byrne et al.

    An analysis of the behaviour of mutation in grammatical evolution

  • M. de la Cruz et al.

    Attribute grammar evolution

    (2005)
  • I. Dempsey et al.

    Foundations in Grammatical Evolution for Dynamic Environments

    (2009)
  • A. Dorin et al.

    Artificial-life ecosystems: what are they and what could they become?

  • W. Fontana

    Algorithmic chemistry

There are more references available in the full text version of this article.

Cited by (0)

View full text