**USE JAVA CODING ONLY,
there might be minimal changes in the required program that will be added. the bid will be updated with the changes as soon as they are deiced upon.
A Java program that uses a *genetic algorithm* approach to identifying words in a list given below. The program will begin with a population of 1000, four letter nonsense words and grow through survival of the fittest to a point where the population contains several of our target words.
*genetic algorithm* requires that you have a *population*, with a *size* and an *initial state*. Individual members of the population are called *alleles*. We will use a population with a size of 1000. Each *allele* will have an initial state of a four letter, uppercase word composed of random characters. You will find it beneficial to let each element of the population also include a variable in which you can store its current *value*. For the purpose of generating the initial population (and several other purposes) you will need a random number generator.
A *genetic algorithm*also requires an *objective function*. This function calculates the 'fitness' of each allele. Based on this fitness value, individual alleles are given greater expectation of surviving and propagating. Your objective function should credit a member of the population with 25 points for each letter in its current state that matches a letter in the same position in one of the target words.
population word target words
The word MXRA scores 25 points when compared to the target word MANY. Only the initial M matches. It scores 0 points when compared to RANK. And it scores 50 points when compared to the target word MORE. The allele should be assigned the fitness value 50, the maximum from all of the target word comparisons.
To fabricate an objective function, we need an objective. In this case the objective is to match as many of the words in the following list as possible. All of the target words, and all of the word states in the population are constrained to be uppercase alphabetic characters. The following 20 four letter, upper case words will be coded into your program for use in the objective function.
EACH LIST BLUE ELSE
NEXT BOOK RANK BOTH
WORK ITEM WALL USED
WHEN MAKE TURN MANY
PLAY LESS THIS HAVE
Use a hash table to keep these target word values. The words have been carefully chosen so that a hashtable will be very efficient.
*genetic algorithm* also requires a *generation phase*, in which the 'most fit' members of the population are used to create new (hopefully superior) members of the population. This phase is sometimes referred to as the *crossover phase* because of the ways in which is often accomplished. The code will allow the top scoring 45% (450) members of the population to survive to the next generation. We will allow this 45% to mix, in pairs to generate a new 45% (450) members of the population. The remaining 10% (100) of the population will be regenerated randomly. (You can play with these percentages to see what effect it has on your results, but these numbers are a good starting point for you.) The top scoring allele and the next to highest will trade some of their characters to make two slightly new alleles. Then the next two top scoring alleles will do the same. The information exchange (crossover) will be accomplished by selecting a random character from one parent and a random character from the other parent and swapping them. Just for the sake of science, we will provide a 3\% chance that one of these crossover characters mutates into a new character during the exchange. In genetic algorithm terms this is called *random mutation*.
Notice that the notion of 'most fit' or 'highest scoring' in the previous paragraph strongly suggests that prior to the generation phase it will be necessary to sort the population by fitness (value). You may use any type of sort that suits you (except an external or system sort).
1) complete source code of all work done.
2) in ready-to-run condition on the platform specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).
4) code should be authentic and made exclusively only for me.
5) use only JAVA.
The program must, in general, do the following things:
build a hash table for the target words
initialize the population
for N generations
evaluate the population
sort the population by fitness
generate a modified population
Where *N* will be 30
From time-to-time the program will produce a member of the population that matches a target word. When this happens, you are to report the match and the generation in which it occured with some appropriate output (e.g. `found: MANY`) to *stdout* and remove that allele from the population. Leaving it in the population would allow it to propagate and result in a, perhaps, excessive number of duplicate matches. This is an arbitrary decision, made in an attempt to get the algorithm to match as many different words a possible. There will be redundant matches, nonetheless, so mark a target word when it is matched and do not report it a second time.