103
define any detail for the locomotion behavior. After
generating new chromosomes, we
obtain the corresponding fitness value by applying the fitness function. The main point on
applying the fitness function is that this function is not a real time procedure and that the
result from the fitness calculation will be only ready after a certain period of time beyond
the time the wave effect will act on robot hinges/actuators. In fact, one cycle of time (i.e.
one period of the wave acting on the actuator) is not sufficient for measuring with good
accuracy the position in space of the robot. Many cycles
of the wave generated are
necessary to be applied to robot actuators. By measuring some robot parameters like the
position of the robot central point, the robot angle (related to the global coordinates of the
system) and so on, the fitness function is quantified. In the initial state of the training phase
the algorithm selects some randomly generated chromosomes.
There is no rule for
evaluating how many chromosomes should be generated in the initial population. This
number varies depending upon the complexity of the problem [149]. Some authors have
defined 100 generations of chromosomes/genes for the initial state [149, 150]. After each
generation, a fitness function is used to evaluate the cost of chromosomes in the simulator
leading to maximum efficiency. During
our computations, each evaluation took approx. 3
seconds and the program spent approx. 60 seconds to evaluate appropriated
chromosomes. After this step, both chromosomes and fitness values will be sorted with the
aim/goal of minimizing the fitness values in a link list.
The next step concerns the
crossover (i.e. both selection and breed) of chromosomes. Our experiments have shown
that 50% of the best chromosomes are fitting for the crossover. It
was found that this range
has a good probability to generating the better chromosomes. In each step, we randomly
select 2 chromosomes in this range for the crossover process. Many evaluations have
shown that the use of the “two
-
point” technique for the crossover
is the best solution
. In
this process we define two points (randomly) on the selected chromosomes; the contents
of the chromosomes between these two points are exchanged (Figure 9-5). In Figure 9-5
P1 and P2 are two randomly selected points. S1 and S2 are two selected
parents
/chromosomes. The crossover leads to two new “children” (see Ch1 and Ch2 in
Figure 9-5) with new properties. During the trial and error process, we obtained that the
good probability for mutation is around 10%. This rate is essential for avoiding the local
minimum trap.
In the long term, this rate of the mutation increases the quality of
chromosomes in the list [151].