Assignment 1 Instructor: Min Chen Hand in your homework: The coding assignment should submit through the blackboard before 11:59PM on the due date. Late Policy: No late assignment can be accepted...

1 answer below »
Coding assignment


Assignment 1 Instructor: Min Chen Hand in your homework: The coding assignment should submit through the blackboard before 11:59PM on the due date. Late Policy: No late assignment can be accepted except: 1. The student has been confined to the hospital or to their room by doctor's orders. 2. The student has participated in an activity approved by their Academic Dean. Collaboration Policy: The assignment need to be completed individually. However, you are encourage to discuss the general algorithms and ideas with classmates and instructor in order to help you formulate your answers to the problems. But we require you to: not explicitly tell each other the answers not to copy answers from anyone or anywhere not to allow your answers to be copied Coding Assignment (100 pts): Implement a Genetic Algorithm (GA) to compute a function 1023X-X2, where 0 ≤ ? ≤ 1023. In order to represent X in binary strings, we need to use 10 bits. The following GA parameters should be used for the initial run of the implementation: The chromosome population N = 20; Crossover probability pc = 0.7; Mutation probability pm = 0.001; Fitness function is defined by: f(X) = 1023X – X2 Stop criterion: set the maximum generation (or iteration) = 20. (Which means that you will stop after 20 genetic cycles). Once the initial population is generated, the fitness of each chromosome needs to be calculated (use the fitness function provided). The chromosome’s chance of being selected for mating is calculated as: Individual chromosome’s fitness / population’s total fitness. (population’s total fitness = sum of all individual chromosomes’ fitness). You are going to use the Roulette Wheel Selection to do the selection. Please go through the lecture slides for details. Code provided: Part of the code is given to you, which have two java classes. GA.java – to do: code to be implemented for the GA part. All methods/classes such as for initialization (encoding), selection, crossover and mutation. runGA.java – main class to start the code. You jobs is to finish the GA.java class and test your results. 1. Show the best fitness you’ve found and the best individual after 10 iterations. 2. Show a plot displaying the best fitness vs. the number of iteration starting with the initial parameter setting. (You can use excel, matlab, or mathematica to generate the plots). Sample plot see below Fig 1. This is only a sample using excel. 3. Show a plot displaying the average fitness vs. the number of iteration starting with the initial parameter setting. (The average fitness is the population’s total fitness/# of individuals). 4. If you want to use 20 bits, the function will be 32767X-X2, where where 0 ≤ ? ≤ 32767. Experiment with the population size, the crossover rate and mutation rate and report on your findings by comparing it with function 1023X-X2 . Submission: Submit your code (source and executable) and you results in pdf via Blackboard. Please put everything in one folder and zip it. 56 45 15 50 34 30 60 98 89 100 0 20 40 60 80 100 120 0 1 2 3 4 5 6 7 8 9 10 Fi tn es s Iteration Best/Average Fitness
Answered 2 days AfterMar 18, 2022

Answer To: Assignment 1 Instructor: Min Chen Hand in your homework: The coding assignment should submit through...

Neetha answered on Mar 21 2022
100 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here