Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in Java Queens problem, where the objective is to place 8 queens on a chess board so that no two queens can attack each

Code in Java

Queens problem, where the objective is to place 8 queens on a chess board so that no two queens can attack each other. A solution corresponding to a goal state is shown in the picture below.

Q
Q
Q
Q
Q
Q
Q
Q

In this question, your objective is to compare the performance of different crossover operators. The crossover operators you need to program are the following: single point crossover, two point crossover, cut and splice, uniform crossover.

You should use the same representation of a chromosome, fitness function, etc. For example, the chromosome or state for the picture above is 86427531.

Your program should first prompt the user for the following input (just input values on a single line, separated by blank space):

Initial population size

Number of chromosomes to select at each iteration or generation of the GA

Mutation rate

Number of iterations or generations to run the GA for; -1 to run the GA until a goal state isfound.

Other parameters can be hardcoded. Then, it should prompt the user to choose one of the crossover operators from a menu. Add an option to exit the program from this menu. After a crossover operator is selected, the program runs. At the end of the run, your program should print (each output on a separate line):

Values of input and hardcoded parameters used (on a single line, comma-separated, format:- )

Number of iterations or generations of the GA executed

Final state reached

Final states fitness function value.

After printing the output, the program should go back to the first menu prompt for another the crossover operator or exit.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago