34
Presented By: Teni Gada- 18. Jaitheradevi- 29. Vani Ganji- 20. Sachin Bhandari- 7. Sumit Debnath- 65.

Genetic Algorithm and Genetic Programming

Embed Size (px)

DESCRIPTION

Genetic Algorithm and Genetic Programming

Citation preview

Page 1: Genetic Algorithm and Genetic Programming

Presented By:

Teni Gada- 18.

Jaitheradevi- 29.

Vani Ganji- 20.

Sachin Bhandari- 7.

Sumit Debnath- 65.

Page 2: Genetic Algorithm and Genetic Programming

Many robotics systems are used in various fields and places in these days.

In order to use robotic systems widely, the robots have to have some

intelligence.

Robots have to adapt themselves to their environment.

The controller of the robots should be able to select the most appropriate

action for a particular situation.

The controller decides upon the most appropriate action by using the Soft

Computing Techniques.

Page 3: Genetic Algorithm and Genetic Programming
Page 4: Genetic Algorithm and Genetic Programming

Genetic Algorithms are good at taking large, potentially huge search spaces

and navigating them, looking for optimal combinations of things required

to solve a problem.

Page 5: Genetic Algorithm and Genetic Programming

A Genetic Algorithm(GA) are guided probabilistic search algorithm modeled after the

Darwinian theory of natural evolution, they are applicable to optimization of controllers.

Page 6: Genetic Algorithm and Genetic Programming

Search for a optimum program which will solve our problem in an most efficient way.

Initial set of Programs which controls my system.

Analyze output from each Initial Program after applying Function onto it.(i.e. Analyzing how accurately the program is controlling my system)

Apply Selection algorithm to reject the Program which does not satisfy the minimum survival criteria( accuracy)

Perform crossover of the random selected program from the program set, creating a new program having good functionality from the two program which is taken into consideration for crossover phase.

Add the new program into the set of Initial programs and continue the algorithm till a optimum program for our controller is created.

Page 7: Genetic Algorithm and Genetic Programming

GA-learning hierarchical fuzzy control architecture is used in Robot Control.

1) The higher level module serves as a fuzzy classifier by determining spatial features

of arm such as

Straight

Oscillatory

Curved.

2) This information is supplied to lower level of hierarchy where it is processed

among other sensory information such as errors in position and velocity for the

purpose of determining a desirable Control input(torque).

3) The Control input will be in turn given to the robot which generates the e(error) and

(overshoot(value greater than expected one).

Page 8: Genetic Algorithm and Genetic Programming

Where,

E – represents the error in angular position.

-represents the overshoot( output exceeding its final, steady-state value).

Therefore, a fitter individual is an individual with a lower overall error in its time

response.

Page 9: Genetic Algorithm and Genetic Programming

I am optimizing the fuzzy logic controller which

is used to control my Robot.. Using the Genetic

Algorithm which works on the principle “the

fittest survives”

Page 10: Genetic Algorithm and Genetic Programming

Several issues should be addressed when designing a

Genetic Algorithm for optimizing fuzzy controllers:

Design of transformation function.

Incorporating initial expert knowledge.

Choice of appropriate function.

Page 11: Genetic Algorithm and Genetic Programming
Page 12: Genetic Algorithm and Genetic Programming

Can a Robot learn to solve problems without being explicitly programmed?

In other words, how can Robot be made to do what is needed to be done, without being told exactly how to do it?"

Genetic programming addresses this challenge by providing a method for automatically creating a working program for the Robot.

Page 13: Genetic Algorithm and Genetic Programming

Genetic programming is a model for testing and

selecting the best choice among a set of programs.

An extension of the genetic algorithm.

The difference between GA and GP is, in GP we use

tree to represent program which is used to solve our

problem.

Page 14: Genetic Algorithm and Genetic Programming

(+ 2 3 (* X 7) (/ Y 5))

+

2 3 * /

X 7 5Y

Functions

Terminals

Randomly generate a program that takes two arguments and uses basic

arithmetic to return an answer

Function set = {+, -, *, /}

Terminal set = {integers, X, Y}

Page 15: Genetic Algorithm and Genetic Programming

• 1.Randomly create an initial population of individual computer programs composed of the available functions and terminals

2. Perform the following steps iteratively until a termination criterion is satisfied◦ a. Execute each program and assign a fitness value to each individual.◦ b. Create a new population with the following steps:

i. Crossover: Create a new program by recombining two selected programs at a random crossover point.

ii. Mutation: Create a new program by randomly changing a selected program.

3. The best sets of individuals are termed as the optimal solution.

Page 16: Genetic Algorithm and Genetic Programming

(+ …)+

Step1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Page 17: Genetic Algorithm and Genetic Programming

(+ 2 …) +

2

Step 1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Randomly Generating Programs

Page 18: Genetic Algorithm and Genetic Programming

(+ 2 3 …)+

2 3

Randomly Generating Programs

Step1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Page 19: Genetic Algorithm and Genetic Programming

(+ 2 3 (* …) …)+

2 3 *

Randomly Generating Programs

Step1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Page 20: Genetic Algorithm and Genetic Programming

(+ 2 3 (* X 7) (/ …)) +

2 3 * /

X 7

Randomly Generating Programs

Step1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Page 21: Genetic Algorithm and Genetic Programming

(+ 2 3 (* X 7) (/ Y 5)) +

2 3 * /

X 7 5Y

Randomly Generating Programs

Step1:

Randomly create an initial population of individual computer programscomposed of the available functions and terminals.

Page 22: Genetic Algorithm and Genetic Programming

(+ 2 3 (* X 7) (/ Y 5)) +

2 3 * /

X 7 5Y

Step 2:

Create a new population using Mutation.

Page 23: Genetic Algorithm and Genetic Programming

(+ 2 3 (* X 7) (/ Y 5)) +

2 3 /

5Y

*

X 7

First pick a random node

Mutation

Step 2:

Create a new population using Mutation.

Page 24: Genetic Algorithm and Genetic Programming

(+ 2 3 (+ (* 4 2) 3) (/ Y 5)) +

2 3 + /

* 3 5Y

Delete the node and its children, and replace with a randomly generated program

24

Mutation

Step 2:

Create a new population using Mutation.

Page 25: Genetic Algorithm and Genetic Programming

(+ X (* 3 Y))

+

X *

3 Y

(- (/ 25 X) 7)

-

/ 7

25 X

Crossover

Step 2:

Create a new population using Crossover.

Page 26: Genetic Algorithm and Genetic Programming

(+ X (* 3 Y))

+

X *

Pick a random node in each program

3 Y

(- (/ 25 X) 7)

-

/ 7

25 X

Crossover

Step 2:

Create a new population using Crossover.

Page 27: Genetic Algorithm and Genetic Programming

(+ X (* (/ 25 X) Y))

+

X *

Swap the two nodes

3

Y

(- 3 7)

-

/

7

25 X

Crossover

Step 2:

Create a new population using Crossover.

Page 28: Genetic Algorithm and Genetic Programming

Step3:

The program produced is tested for fitness.

• If the result is satisfying the fitness criteria we select the program produced as the best way to solve the problem

Else

• Iterate the Genetic Programming steps again to produce a new program.

Page 29: Genetic Algorithm and Genetic Programming

1.A single robot is placed at a random position and orientation in a rectangular driving

area closed by walls.

2.A colored ball is also placed at a random position.

3.Using its camera, the robot has to detect the ball, drive towards it, and stop close to it.

4.The robot camera is positioned at an angle so the robot can see the wall ahead from

any position in the field.

GOALS

•Find ball in environment

•Drive towards it

•Stop when close to ball

Page 30: Genetic Algorithm and Genetic Programming

In the loop, grab an image and analyze it as follows:

1)Convert the image from RGB to HSV (Hue, Saturation and Value).

2)Use the histogram ball detection routine (this returns a ball position in the range [0..79]

(left.. Right) or no ball and a ball size in pixels [0..60]).

3)If the ball height is 20 pixels or more, then stop and terminate (the robot is close

enough to the ball)

–Otherwise

•If no ball is detected or the ball position is less than 20, turn slowly left.

•If the ball position is between 20 and 40, drive slowly straight

•If the ball position is greater than 40, turn slowly right.

Page 31: Genetic Algorithm and Genetic Programming

If the ball height is 20 pixels or more,

then stop and terminate (the robot is

close enough to the ball).

OtherwiseIf no ball is detected or the ball position is

less than 20, turn slowly left.

If the ball position is between 20 and 40,

drive slowly straight

If the ball position is greater than 40, turn

slowly right.

Page 32: Genetic Algorithm and Genetic Programming
Page 33: Genetic Algorithm and Genetic Programming
Page 34: Genetic Algorithm and Genetic Programming

Thank You