Web Development Link Programming Link Other Media Link Contact Me Link
Programming Logo

This section is intended to give you an overview of application development I have been involved in. Currently only my dissertation project is discussed as it is far bigger than any other application projects I have produced. However while at university I completed many short Java coursework projects, some Assembler coding, and a little Dashcode and C# for the iPhone platform.

Dissertation Logo

Tracing Ancestry in Genetic Programming seemed like one of the more interesting topics to do my dissertation on out of the hundred or so we had to pick from. Although when choosing the research based topic it was something I had not heard of previously. It's a difficult concept to grasp at first but with research, the help of my tutor and the PDF book A Field Guide to Genetic Programming I was able to understand it.

Genetic programming is an area of programming where programs are created automatically to find a solution to a given problem. To work with genetic programming, you need to use an algorithm that can evolve a set of data. I used one called Tiny GP. The genetic algorithm is initially given a set of random programs and applies the Darwinist principle of survival of the fittest to them over many generations to find the best solution to the problem.

Programs evolve in a similar way to nature where the fittest members of a population in a given generation produce a child for the next generation. Programs may also mutate into other programs over the course of a generation. After each generation, the programs should become more efficient at solving the given problem until eventually a suitable solution is found. This could take any number of generations.

The purpose of my project was to find a way of storing the masses of information that is produced with each generation, meaning storing each program as an object with its parameters. This data had to be easily accessible so that a user could look at specific programs and find its parents, grandparents and so on. This meant you could trace its history like a family tree and see where it evolved from.

The project was developed in the Java language. Below you can see one of the methods I created to interact with the data. The method is called whenever a user asks to find a parent, grandparent or tree. The method basically sets up the initial program that the user wishes to look at in detail.

   public void request(int minimum) {
        //Minimum generation number that the user can request parents from.
        int minGen = minimum;

        Scanner input = new Scanner(System.in);

        //Ask the user to input the generation number.
        String sgen = "";
        while ((gen > (userGen - 1)) || (gen < minGen) || (!isInt(sgen))) {
            System.out.println("Please input the generation number of your desired" +
                    " program: ");
            sgen = input.next();

            /*Convert the variable to an int if it was an int.
            Check must be performed to prevent exception.*/
            if (isInt(sgen)) {
                //Convert the value to an int.
                gen = Integer.parseInt(sgen);
            }
            
            //Only print error message if it was in fact an error.
            if ((gen > (userGen - 1)) || (gen < minGen)) {
                System.out.println("\nError: Invalid input. You must enter a number" +
                        " from " + (minGen) + " to " + (userGen - 1) + ".");
            }
        }

        //Now ask the user to input the program number.
        String sprog = "";
        while ((prog > 9999) || (prog < 0) || (!isInt(sprog))) {
            System.out.println("Please input the program number of your desired " +
                    "program: ");
            sprog = input.next();

            /*Convert the variable to an int if it was an int. Check must be 
              performed to prevent exception.*/
            if (isInt(sprog)) {
                //Convert the value to an int.
                prog = Integer.parseInt(sprog);
            }
            
            //Only print error message if it was in fact an error.
            if ((prog > 9999) || (prog < 0)) {
                System.out.println("\nError: Invalid input. You must enter a " +
                        "number between 0 and 9999.");
            }
        }

        //Print the program requested.
        Program gp = tiny_gp.generations[gen].pop[prog];
        System.out.println("\nThe following program, found in " +
                "Generation " + gp.genNo + " and is Program #" + gp.progNo + ": ");
        tiny_gp.print_indiv(gp.data, 0);
        System.out.println("\nFitness: " + gp.fitness);

    }

The project involved more than just programming, I went through the full Software Development Life Cycle, used a Gantt Chart for project management and produced a dissertation document at the end with over 10,000 words.