Object Oriented Genetic Programming

Jinfei Fan

Abstract

Learning from nature, people have developed several types of evolutionary algorithms. The most widely known evolutionary algorithms, often used to optimize parameters, are called Genetic Algorithm (GA). GA has some basic elements called genotype, which simulates the inheritable material, and phenotype, which simulates the organism. Genetic programming (GP) is a special branch of GA. Compared with GA, whose genotype is a parameter-encoding bit string, the genotype of GP is a computer program. For example, automatically defined function (ADF) is one type of GP. Examples of problems tackled with ADF are symbolic regression, ant hill, machine learning, etc. The program is represented as a tree.

As the software technique evolves from structured programming to object oriented programming, there are efforts trying to apply object oriented aspects to genetic programming, which are called object oriented genetic programming (OOGP). There are very few papers exploring reflection in OOGP. However, there is no paper and no available research about how to represent object oriented programs for use by GP.

I am doing some research using code document object model (CodeDOM) to represent the programs in OOGP. The CodeDOM is a mechanism within the dotNET Framework whereby the source code can be dynamically generated in multiple programming languages at run time, based on a single model that represents the code to render.

For example, if the source code is

myDouble_3.Minus(myDouble_5);,

the CodeDOM code is

CodeMethodInvokeExpression Invoke =  new
CodeMethodInvokeExpression(new
CodeVariableReferenceExpression(myInstr.VariableName),
myInstr.MethodName, new CodeExpression[] { new
CodeVariableReferenceExpression(myInstr.Parameters) });

Statements.Add(Invoke);,

where the object myInstr is assigned in the genotype as ( VariableName=myDouble_3, MethodName=Minus, Parameters=myDouble_5).

The genotype in OOGP is another level of abstraction from the CodeDOM. It makes the genetic manipulation of the object oriented programs much easier. For example, we can just swap the method’s names in two statements, meanwhile using reflection to check if the parameters are valid.

There are many areas that can be researched in OOGP. Since GP needs to evaluate the programs that it generates, test methodology for the object oriented software can also be adapted. Other meta-object models than CodeDOM can be explored. To improve the speed of OOGP, the compiler should be run as daemon.