Thursday, January 12, 2012

First Results in Rule Optimizing

Using the geva library from the natural computing research and application group leads to the first results.
Using geva you must invert the fitness value. Low value means high fitness. A value of 9000 means that the opponent is almost immedately thrown out of the arena. So we can see the breeding was really very successful.
This are the rules that where breeded.

RULEBLOCK GENERATED
 OR : MAX ; 
 ACCU : MAX;
 RULE 1 : IF  opponentDir IS invisible THEN leftVelo IS backward , rightVelo IS forward  ;
END_RULEBLOCK

 
The only generated rule focuses only on the opponent, and means turn around as long as you do not see the opponent. Otherwise use the default behaviour, which is go straight ahead if no rule matches. Very simple but effective.

The opponent was the manually desined fuzzy controlled robot using the following rules.

RULEBLOCK No1
    AND : MIN;
    ACT : MIN;
    ACCU : MAX;

    RULE 1 : IF opponentDir IS invisible
                    AND frontBorderDist IS near
                    AND leftBorderDist IS near
                    AND rightBorderDist IS near 
                THEN
                    rightVelo IS fastBackward,
                    leftVelo IS fastforward;

    RULE 3 : IF opponentDir IS invisible
                    AND (leftBorderDist IS medium OR leftBorderDist IS far)
                    AND rightBorderDist IS near
                THEN
                    leftVelo IS standstill,
                    rightVelo IS forward;

    RULE 2 : IF opponentDir IS invisible
                    AND leftBorderDist IS near
                    AND (rightBorderDist IS medium OR rightBorderDist IS far)
                THEN
                    rightVelo IS standstill,
                    leftVelo IS forward;

    RULE 4 : IF opponentDir IS left
                THEN
                    leftVelo IS fastforward,
                    rightVelo IS forward;

    RULE 5 : IF opponentDir IS right
                THEN
                    leftVelo IS forward,
                    rightVelo IS fastforward;

    RULE 6 : IF opponentDir IS center
                THEN
                    leftVelo IS fastforward,
                    rightVelo IS fastforward;

END_RULEBLOCK


You can see that robot, fighing against a clone of itself using the follwing link: Manual vs Manual



Wednesday, December 14, 2011

Another low variance long running session

This will probably be the last parameter optimizing session, as parameter optimizing does not bring the expected results.
The average fitness never exceeds 1000. After 1000 generations there is an improvement in the maximum values, but the no further advancements.
Have a look at the robots after 0, 300, 1000 and 2216 generations.

A long running low variance breeding session

This breeding session generated the absolute maximum average (and max) fitness. Relatively fast it rises to more than 10000 in average. That means that more than half of the individuals of a population could win their matches against the reference robot.
Why could there no further improvement? No idea.
See the robots in action after:
0, 1000, 2000 and 2384 generations

Thursday, December 8, 2011

Low variance initial generation

As the performace of the results of parameter optimizing did never get even near the results of the manually designed fuzzy controllers, I tryed to make the inital generation almost equal to the manually choosen parameters (low variance). The GA sould not find a better solutioion somewhere in the waste area of parameters, but find an optimized solution staring at a almost optimal solution.
Here are the results of that.

The fitness rises immediately to a much higher average and maximum than in the sessions with random initial generation (see the results in older posts).
Here are some of the best performers of their generations. The violet sumo is the 'breeded' one.

Another long running breeding session

See the behaviour after several generations.

A long running breeding session

I let a session run for several days (on my not very fast computer) to see what happens after several thousand generations.
The result of that session shows that a minimum improvement can be achieved after a view hundred generations.
Check the behaviour of the fittest individual in that phase.
The pink sumo robot contains the 'breeded' controller whereas the blue one is controlled by a manually designed fuzzy controller. Obviously the breeded robot does not have a chance towin against the manually designed one. Even not after more than 1900 generations.
Here are some more breeded robots after the increase of fitness at about 3500 generations.