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



No comments:

Post a Comment