Академический Документы
Профессиональный Документы
Культура Документы
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
ROBOTC PROGRAMMING
11.5.Genetic Operators
A crossover operatore is done by taking a random point and swapping the left (or right) side of the parent chromosomes. This creates the chromosomes of the children.
A mutation operator is done when a random position in a chromosome is selected and the value is inversed.
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
ROBOTC PROGRAMMING
11.7.Darwin Genetic Algorithm: 1.The Chromosome Coding and. 2. Initializing the Population
For the chromosomes, it is necessary to have a coding for each of the directions: Forward = 1 Left = 2 Right = 3 Backwards = 4 Turning is not required since an omnidirectional drive is used
At the beginning of the program, the first step is to initialize a population, and.. .. to create a maze, and place it into a 8 by 8 maze. We do this by creating a for loop filling in numerical values into the array. The coding is as below: 7 is the start 8 is the goal 9 is a wall
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
7 = starting point
8 = goal
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
11.8.Darwin Genetic Algorithm:The code for initializing the shape of the maze
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
7 = starting point
8 = goal
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
This is done by creating a for-loop which assigns random movement values (1-4) into a integer array of 21 (the number of unused space in the maze).
Each chromosome is part of a vector with 1000 chromosomes (the population).
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
Note that !
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING
Note that the goal sequence is: 333112111222244444434 We first fill in the maze. The next step is to see how far the robot (orange square) goes. Now we calculate the fitness by first seeing how far it went: 10 21-10 = 11 which is the fitness value
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
Then, we are ready for calculate the other fitness values and for selection of the best chromosomes and apply the genetic operators (shown before). ROBOTC PROGRAMMING
References
Marek Perkowski, Class Mat. http://web.cecs.pdx.edu/~mperkows/CLASS_479/lectures-2006.html http://www.codeproject.com/Articles/26203/Genetic-Algorithm-Library Inteligent Computing Lab. http://iclab.life.nctu.edu.tw/POPI/doc.php#cont http://www.frank-dieterle.de/phd/2_8_5.html Alan Cheng, Robot Project Report , http://web.cecs.pdx.edu/
TEMPUS IV Project: 158644 -JPCR Development of Regional Interdisciplinary Mechatronic Studies DRIMS
ROBOTC PROGRAMMING