Box moving by LGPC

GPによるロボット行動のシミュレータです

はじめに

このプログラムの目的は、ロボットがある不規則な部屋の真ん中に置いてあるボックスを壁へ押し寄せることである。黒い部分は障害物である。障害物の部分を除いて、ボックスは壁の任意の部分に押し寄せられると、タスクは終了する。

操作方法

①Room
ロボットが動く範囲で、赤い正方形はロボットが押し寄せるボックスである。

②コード
各世代の最良の個体のコードを示している。

③ボックスに関する設定
Box position: 始める時のボックスの位置。
Box size: ボックスのサイズ。
Trajectory: ボックスが移動されるとき、軌跡を表示すると非表示する設定。
Delay: ロボットが歩く時に各ステップの間の止まる時間。

④選択策略の設定
Genetic Programming (GP)選択方法とEvolutionary Strategy (ES)選択方法とのどちらかに使用か設定する。(GPとESの選択の区別はWolfgang Banzhaf等著、伊庭 斉志等訳『遺伝的プログラミング』のpp117を参考してください)

Population Size: GPの個体数。
Generation num: 世代の数を指定する。
Cross Rate: 交差の確率をここで指定する。
Elitism Rate: エリートの比率。
Mutation Rate: 突然変異の確率。
Robot Total Step: ロボットが止まるまでのステップ数。
Depth of Gene: 進化し始まるときのGeneの深さ。
Max Depth of Gene: 進化中のGeneの最大深さ。

⑤Tournament Size
このプログラムは個体の選択がトーナメントという方法で行われる。ここで、トーナメントに参加する個体の数を設定する。

⑥Fitness cases
Fitnessは設定したステップが終わった時、ボックスと壁の間の最小の距離のことである。ロボットの初期位置を、Fitness caseと呼ばれる。このプラグラムにおいて四つのFitness casesを設定している。ここで、ロボットの初期位置を設定する。そして、四つのFitness caseのどちらかに使用することによって、そのFitness caseの前のcheckbox を選択しておく。ただし、ひとつの選択しないと運転できない。

⑦Fitness
選択したFitness casesの総数はFitnessとしてここで表示する。横軸は進化の世代数であり、縦軸はFitnessである。

⑧Start
スタートボタンであり、これを押すと、プログラムを運行する。

⑨Test
テストボタンである。進化が終わったあと、それぞれの世代の最良個体がテストできる。右側で世代の数を設定した後、このボタンを押すと、ロボットは『2』のコードに従って、動くようになる。

⑩Exit
プログラムが終わる。

⑪About
About Box を表示する。


既知なバグと欠点

How to run

The aim of this program is to let robot push box, which is placed in an irregular room, to side of the room. The black parts are obstacles. The task is considered accomplished when any part of box touched wall. The main part of interface will be explained in following paragraphs.

①Room
which robot is placed, the red square is the box that will be pushed by robot.

②Code
The best individual’s program, which generated by GP.

③Parameter of Box
Box position: to setup initial coordinate of box.
Box size: to setup box’s size.
Trajectory: to select whether the trajectory should be drawn or not.
Delay: Set this number to decide delay-time between two steps of robot.

④Selection algorithm
There are two algorithms that are used in this program; one is Genetic programming (GP) algorithm, another is Evolutionary Strategy (ES) algorithm. User can select between these two algorithms. (Please refer to “Genetic Programming” for detail about GP selection and ES selection algorithms.)

Population Size: setup number of individuals
Generation num: setup number of Generations
Cross Rate: setup the probability of crossover operation
Elitism Rate: setup the rate of directly copy elitist individual to next generation.
Mutation rate: setup the probability of mutataion.
Robot total step: setup the total steps of robot in one running.
Depth of Gene: setup the initial depth of individual’s gene.
Max Depth of Gene: setup the maximum depth.

⑤TournamentSize
This program used Tournament algorithm to select parent from individuals, set the size of tournament in this edit box.

⑥Fitness cases
Fitness of this program is defined as the minimum distance from box to wall. We defined fitness cases as the fitness that according to different positions of robot. In this program, we set 4 fitness cases. The position of each fitness case can be set here, and user also can select whether each fitness case will be used or not by checking the checkbox of it. Note that if you did not check any of them, the program will not run correctly.

⑦Fitness
The fitness of each individual is the sum of selected fitness cases, here the x-axis is number of generations y-axis is fitness.

⑧Start
The start button, press this button to run the program

⑨Test
The test button, after evolution, you can see the result of each generation by pressing this button. Just to select generation number by input number in the edit-box and press this button, the robot will run according the code, which is shown in part 2.

⑩Exit
to terminate

⑪About
to show the about box.

Known bugs and defects