Tetris and Genetic Algorithms Math Club 5/30/2011.

Slides:



Advertisements
Similar presentations
Logical and Artificial Intelligence in Games Lecture 14
Advertisements

Biologically Inspired Computing: Operators for Evolutionary Algorithms
Exact and heuristics algorithms
Tetris – Genetic Algorithm Presented by, Jeethan & Jun.
Case Study: Genetic Algorithms GAs are an area of AI research –used to solve search problems with potentially better performance than traditional search.
Genetic Algorithms By: Jacob Noyes 4/16/2013. Traveling Salesman Problem Given:  A list of cities  Distances between each city Find:  Shortest path.
Biologically Inspired AI (mostly GAs). Some Examples of Biologically Inspired Computation Neural networks Evolutionary computation (e.g., genetic algorithms)
21-May-15 Genetic Algorithms. 2 Evolution Here’s a very oversimplified description of how evolution works in biology Organisms (animals or plants) produce.
Evolutionary Computing A Practical Introduction Presented by Ben Paechter Napier University with thanks to the EvoNet Training Committee and its “Flying.
Genetic Algorithms. Some Examples of Biologically Inspired AI Neural networks Evolutionary computation (e.g., genetic algorithms) Immune-system-inspired.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Data Mining CS 341, Spring 2007 Genetic Algorithm.
Introduction to Genetic Algorithms Yonatan Shichel.
Genetic Algorithms Learning Machines for knowledge discovery.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Brandon Andrews.  What are genetic algorithms?  3 steps  Applications to Bioinformatics.
Genetic Algorithm.
© Negnevitsky, Pearson Education, CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University.
Soft Computing Lecture 18 Foundations of genetic algorithms (GA). Using of GA.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Ch.12 Machine Learning Genetic Algorithm Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2011.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Genetic Algorithms Michael J. Watts
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
1/27 Discrete and Genetic Algorithms in Bioinformatics 許聞廉 中央研究院資訊所.
Today’s Topics Read –For exam: Chapter 13 of textbook –Not on exam: Sections & Genetic Algorithms (GAs) –Mutation –Crossover –Fitness-proportional.
Derivative Free Optimization G.Anuradha. Contents Genetic Algorithm Simulated Annealing Random search method Downhill simplex method.
GENETIC ALGORITHMS.  Genetic algorithms are a form of local search that use methods based on evolution to make small changes to a popula- tion of chromosomes.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
Is One Better than None? Does foresight allow an artificial intelligence to survive longer in Tetris? William Granger and Liqun Tracy Yang.
Tetris Agent Optimization Using Harmony Search Algorithm
Chapter 12 FUSION OF FUZZY SYSTEM AND GENETIC ALGORITHMS Chi-Yuan Yeh.
1. Genetic Algorithms: An Overview  Objectives - Studying basic principle of GA - Understanding applications in prisoner’s dilemma & sorting network.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
Charles Darwin’s Theory of Natural Selection and its significance as a mechanism of Evolution.
N- Queens Solution with Genetic Algorithm By Mohammad A. Ismael.
1 Autonomic Computer Systems Evolutionary Computation Pascal Paysan.
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
1 Comparative Study of two Genetic Algorithms Based Task Allocation Models in Distributed Computing System Oğuzhan TAŞ 2005.
EVOLUTION …via Natural Selection. Organisms produce more offspring than can survive.
Advanced AI – Session 6 Genetic Algorithm By: H.Nematzadeh.
GENETIC ALGORITHM By Siti Rohajawati. Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
March 1, 2016Introduction to Artificial Intelligence Lecture 11: Machine Evolution 1 Let’s look at… Machine Evolution.
Natural Selection. A. Species overproduce offspring that may survive an environment. B. There is little variation among members of a population. C. Competition.
Genetic Algorithm (Knapsack Problem)
Genetic Algorithms 11-Oct-17.
Introduction to Genetic Algorithms
Using GA’s to Solve Problems
Genetic Algorithms.
Genetic Algorithms.
CS Fall 2016 (Shavlik©), Lecture 12, Week 6
CS621: Artificial Intelligence
Genetic Variation & Natural Selection
CS Fall 2016 (Shavlik©), Lecture 12, Week 6
Genetic Algorithms 25-Feb-19.
Searching for solutions: Genetic Algorithms
History of Biological Diversity Evolution: Darwin’s travel
Genetic Algorithms 26-Apr-19.
Biologically Inspired Computing: Operators for Evolutionary Algorithms
SURVIVAL OF THE FITTEST
Presentation transcript:

Tetris and Genetic Algorithms Math Club 5/30/2011

 In biology, evolution is a process driven by random mutations, yet it produces very good results over time.  A genetic algorithm is derived from nature’s mechanism of evolution. What is a genetic algorithm?

How does evolution work?

 Variation: Organisms in a population must be slightly different from one another.  Inheritance: Traits of parent organisms must be passed onto their offspring.  Limited space: Only some of the offspring in any generation is able to survive and pass on its genes.  Competition: Individuals that are more fit are more likely to pass on their genes to the next generation. What are the mechanisms?

 A chromosome which expresses a possible solution to the problem as a string  A fitness function which takes a chromosome as input and returns a higher value for better solutions  A population which is just a set of many chromosomes  A selection method which determines how parents are selected for breeding from the population  A crossover operation which determines how parents combine to produce offspring  A mutation operation which determines how random deviations manifest themselves How do you write a genetic algorithm?

 How do you make a computer program to play tetris?  More generally, how do you play tetris? A Tetris AI

 As I’m sure most of you know, in tetris you have blocks of four (tetrominoes) falling from the top of the board. The player moves and rotates the blocks and stacks them up: Rules

 Here the black outline is one of the places you can put the funny shaped block. And when a row is filled entirely with blocks (the row with the red outline below), you get a clear; that entire row is removed and the rest of the board is shifted down (often with a series of beeping noises and a small increase to your score): Rules

 We’re going to make a method to score tetris positions (determine which positions are good and which are bad)  The AI is going to go through each position and choose the best possible one. Tetris AI - Outline

 It makes sense to penalize height since when all the blocks are stacked up to the top, you lose:  It also makes sense to reward clears. Strategies

 It also makes sense to penalize holes and blockades: Strategies

 To get a score for a position, we would use something like this:  Score = A * Sum of Heights + B * Number of Clears + C * Number of Holes + D * Number of Blockades  Maybe A=-0.03, B=8.0, C=-7.5, D=-3.5? Putting together a tetris AI

 The problem is we are choosing the weights pretty much arbitrarily. They might work well or they might not, but we don’t really know whether there are better values for them.  Let’s solve this problem by using a genetic algorithm to find the best weights for the AI. What about genetic algorithms?

 A chromosome which expresses a possible solution to the problem as a string  A fitness function which takes a chromosome as input and returns a higher value for better solutions  A population which is just a set of many chromosomes  A selection method which determines how parents are selected for breeding from the population  A crossover operation which determines how parents combine to produce offspring  A mutation operation which determines how random deviations manifest themselves How do you write a genetic algorithm?

 The chromosome is pretty simple – just an array of four weights. Chromosome

 The fitness function is also simple – the score is just the number of lines the AI runs for before it dies. Fitness Function

 We are going to use a form of tournament selection: Selection Method

 Also pretty simple, make the new chromosome by randomly choosing the four values from the parent chromosomes. Crossover

 We have a 10% chance of a mutation – a chromosome that is different from either parent’s. Mutation

 Yes, we can play with the tetris now :D The End