Tuesday, September 30, 2014

Difficult progress

The code is misbehaving. Also I am having trouble with display. What should I choose to display the movement?
Blender seems like a good choice. Will look into that. It is also written in python.

Once I complete the mapping algo I will move on to the next thing.
Extracting equations from datasets using GA.
I read somewhere that Koza did this. Intentionally not reading up on his work. Will read after my experiment. That way I get to learn stuff on my own and so it sticks.


As the blog link states it is difficult for me to stick to a problem when i keep on failing. I guess that is just what is takes.

Going home for now. Will write again after some work.

Tuesday, September 23, 2014

Simple map navigation

Ok.
This is now an official attempt to navigate a given map using genetic algorithms. I will be using the techniques explained in the previous post.
Genetic algorithms.
Look at the git page.

Now to explain the code.

  1. The gene
    1. The gene is composed of 'l' 'r' 'u' 'd'.
    2. each letter corresponds to a left, right up down movement on the map.
  2. The map
    1. the map is composed of empty spaces
    2. walls are determined by '0'
    3. entry point is 1
    4. target is 2
  3. The roulette function
    1. This can select a gene from a population based on the weights.
    2. It can select max and min fitness
With that done ill leace the rest of the code to be seen and read by you.

Monday, September 22, 2014

Genetic Algorithms

After a week of reading I see that we need to start with Genetic Algorithms.
So here is a brief description of what ill be making over the course of next week.

In a general algorithm for computing we see that alll the steps are defined by the programmer beforehand.

In GA we try to encode the solution set to be represented in a genome. This genome is simply a collection of instructions which when followed will lead to a solution.

This solution may not be optimum, it might even be barely solving the problem. However it is a solution.

eg. A good example is a collection of directions. 'lrlrllrrlrlllr'
This might not get the vehicle to the objective. However it is a possible solution.

First we create a population of these genomes. Thus the task of solving the problem is reduced to simply correctly representing the problem's solution  in a genome.

After this, we simply let the population evolve using two techniques. Crossover and Mutation rate. The evolution creates very optimized solutions for the problem due to natural selection.

In GAs the natural selection is carried out by the 'fitness' function. The method by which the fitness,crossover and mutation functions do their tasks may be varied to have different results.

Thus genetic algorithms are very good for searching things where the solution space is very large.
eg. If you need to search for a specific mathematical equation which correctly predicts a given data set, the search space is essentially all the possible mathematical equations. Here exhaustive searching will take a long time. Thus GAs will prove to be useful here.