1
00:00:00,390 --> 00:00:08,310
Hello and welcome to this lecture, where we are going to implement another step of the genetic algorithm.

2
00:00:08,850 --> 00:00:18,780
Last lecture, we implemented the codes to evaluate the population and also order the results.

3
00:00:19,080 --> 00:00:25,530
We are keeping the best solutions should they lower positions of the list.

4
00:00:25,920 --> 00:00:31,080
And now we will continue talking about the evaluation.

5
00:00:31,590 --> 00:00:33,900
We can see here the results.

6
00:00:34,170 --> 00:00:40,530
For example, in the first position of the list, we can see the best solution.

7
00:00:40,980 --> 00:00:45,180
Fifteen thousand five hundred and forty four.

8
00:00:45,540 --> 00:00:54,090
And in this sad composition, this score is equal to fifteen thousand one hundred and thirty two.

9
00:00:54,510 --> 00:01:04,050
And now what we need to do is to set the best solution to our genetic algorithm objects.

10
00:01:04,380 --> 00:01:14,850
For example, before we had defined these three here, best solution initialized as none.

11
00:01:15,270 --> 00:01:25,160
And when we initialize the population, we are setting the best solution, as the first was the issue

12
00:01:25,170 --> 00:01:28,320
of the list position number zero.

13
00:01:28,560 --> 00:01:39,810
However, at this point of these codes, we haven't ordered the population yet, so we need to implement

14
00:01:39,810 --> 00:01:42,450
another function chalkboards.

15
00:01:42,720 --> 00:01:48,930
The first was the issue of the list should these best solution here.

16
00:01:49,350 --> 00:02:00,150
So we are going to implement and the will function bethe best individual it will receive as a barometer,

17
00:02:00,780 --> 00:02:02,910
ie specific individual.

18
00:02:03,270 --> 00:02:15,570
And we are going to implement an if statement if individual dots score evaluation is greater than the

19
00:02:15,570 --> 00:02:20,850
best solution, but score evaluation.

20
00:02:21,270 --> 00:02:31,740
We are comparing this score of the parameter that we are going to sans with this score of the best solution,

21
00:02:32,100 --> 00:02:39,030
which is these are true both here, which is initialized as the first position.

22
00:02:39,480 --> 00:02:45,390
We will do some tests in some sequence, then it will be easier to understand.

23
00:02:45,930 --> 00:02:51,390
So let's axis self based solution.

24
00:02:51,810 --> 00:03:02,910
If this if statement is true, the best solution we receive the individual let's run this code again

25
00:03:02,910 --> 00:03:04,800
should create the glass.

26
00:03:05,370 --> 00:03:09,630
Let's go back to this part of the implementation.

27
00:03:10,260 --> 00:03:13,250
I will create a new population.

28
00:03:13,260 --> 00:03:16,050
We can check the values here.

29
00:03:16,860 --> 00:03:19,680
Let's run this sale of codes.

30
00:03:20,010 --> 00:03:31,980
We can see that's the first position is the best results and the last position is the worst results.

31
00:03:32,490 --> 00:03:41,400
Now we can take a look at the values genetic algorithm based solution, the attributes.

32
00:03:41,760 --> 00:03:53,670
Let's take a look at the score, which is equal to five thousand, which means these individual 16.

33
00:03:54,060 --> 00:04:04,950
So when we initialize the the population for the first time, this individual 16 was in the first position

34
00:04:04,950 --> 00:04:12,660
of the list in position number zero and see that the value is not a good solution.

35
00:04:12,990 --> 00:04:23,760
So now when this to gets the best individual off this list and boards in these attribute here, the

36
00:04:23,760 --> 00:04:25,200
best solution.

37
00:04:25,620 --> 00:04:34,770
Just to compare the results, we can access genetic algorithm population in position zero.

38
00:04:35,130 --> 00:04:36,090
Let's see.

39
00:04:36,480 --> 00:04:38,310
Score evaluation.

40
00:04:38,880 --> 00:04:40,650
Run this code.

41
00:04:41,010 --> 00:04:52,680
See that the bad their value is seventeen thousand exactly the same we have here in the first position

42
00:04:52,680 --> 00:04:53,700
of the list.

43
00:04:54,120 --> 00:04:59,420
Now we can just call our new function genetics.

44
00:04:59,850 --> 00:05:07,290
Or Adam Dot's best individual and the wind is to sand as a barometer.

45
00:05:07,720 --> 00:05:14,430
The first elements of the list, let's run this codes.

46
00:05:14,790 --> 00:05:24,450
That's if statement we implement it will be executed, so we will just change the individuals before

47
00:05:24,690 --> 00:05:26,430
the best in the video.

48
00:05:26,670 --> 00:05:28,530
Was this one here?

49
00:05:29,130 --> 00:05:30,720
VIDEO 16.

50
00:05:30,960 --> 00:05:37,740
And now that basked in the video of the population is the first position of the list.

51
00:05:38,130 --> 00:05:45,530
To see the results, we can just copy paste and run these codes.

52
00:05:45,970 --> 00:05:53,580
Before this was the best solution, and now we change, it's should the best solution.

53
00:05:53,650 --> 00:06:02,730
Considering the ordered list, it's a very simple function just to update these attributes here.

54
00:06:03,120 --> 00:06:14,700
We can also take a look at the chromosome genetic algorithm based solution thoughts from a sun room.

55
00:06:14,700 --> 00:06:25,020
This codes we can see here the list of products that we are going to load on the truck to get this value

56
00:06:25,020 --> 00:06:30,000
here in the next lecture, we are going to continue the implementation.

57
00:06:30,390 --> 00:06:31,110
See you there!
