Hi, thank you for updating my code. I runned it using a short string like "HELLO" and and the program was able to guessd the string hello as final answer correctly. However, when i tried input long string to guess it then it couldnt do that. Below is the sample of input that tried running. I think im missing something in the toString method or so. Kindly assist. Thank you
Hi, thank you for updating my code. I runned it using a short string like "HELLO" and and the program was able to guessd the string hello as final answer correctly. However, when i tried input long string to guess it then it couldnt do that. Below is the sample of input that tried running. I think im missing something in the toString method or so. Kindly assist. Thank you
Enter string to guess: "For God loves the world and His mercry endured forever His grace is so suffient to everyone on the earth"
Enter number of organisms per generation: 50
Enter number of generations: 100
Enter mutation probability (between 0 and 1): 0.01
Generation 10: Best Answer - FveMzG {LBZeqlXzaodXpOV ZgjxwlFvorScpoRScHhPnG wtkqvri {OlP[cvfLLqEWstoeoIJcF xnVDVtEAbeYnf Hv [vM {EZxT, Average Fitness: 15.72
Generation 20: Best Answer - Foe [wlKllTQiJgpsfdXcnV {tCBtSf okDxvCodjHOPnO Mfdqvki {Ol [cvlXDimFonmkTfUSVnC BgpqqMb Ynf Gn zvM {EZxy, Average Fitness: 24.92
Generation 30: Best Answer - FyM [wkFooFbGKyrl NXylV ZODxdISacrbcyoRfzKbqnG MfAlvyb {Ol AcvZXZlmWstVeoffnznCsQGlrLMbeYnB Bn AvM {EZwD, Average Fitness: 28.4
Generation 40: Best Answer - FyM [wunsYFbCKyul BXhBV yMjBobf {Umcpm i UOPTv HukqvkL UOl fwD [ZimWsgpkEfvUvnCxKblrLsbejnB Rv iCM {EnWh, Average Fitness: 30.92
Generation 50: Best Answer - FoM [VtRFoFem Xzs NXylV aaDBebfpNUmlmQHcudBmnmp[ukVvtZ {Os fwDR[Zim swpkEfvUvnkxKbXrwMbePnB Gn yvM {pZpA, Average Fitness: 32.62
Generation 60: Best Answer - FBP CVtRdoFeQ Xzs NXglp qtvBwlRUmUmbpm Z tyPIy HukuvD sIOB gZDckZim sIpeofvUQnCbKiBlNqbnYnzJGnubVM {OOju, Average Fitness: 36.64
Generation 70: Best Answer - FBP qVtRdoFeQZXzs NXylm VtpSUbw {Urbpp Z sylIv suklvBB Ros gZvgvOiq ZIpeOtOh nY MgpQsvbjjnJZGn YVM {pOoE, Average Fitness: 37.96
Generation 80: Best Answer - FMR [sLRXoFeC yrh NXylV aSpSUNxJmdTcpE Z ThUTv Wc RPks rUi Rf cNZiK sgpbVovOtnY MgpLivUPVKB Gi wVYjenita, Average Fitness: 36.68
Generation 90: Best Answer - FoMuqsZpJoFeg Vrh NgylV aSuzUbtVmbNcpy ZysyPIw GukvvoivHzs gZvgkZom xoovEtQUanMWBLqrIcHUvnf Gq YvM { OGg, Average Fitness: 39.9
Generation 100: Best Answer - RMT VqLRXoOeg AzEEUcdlJ ctDWwi YSHFcpy ZSAwiIw HjkJvoSvHzs gZxgkGom TCKkmYQUHnCxwO lLGIHCnf fn YvM {aOGh, Average Fitness: 37.96
Final Answer: RMT VqLRXoOeg AzEEUcdlJ ctDWwi YSHFcpy ZSAwiIw HjkJvoSvHzs gZxgkGom TCKkmYQUHnCxwO lLGIHCnf fn YvM {aOGh

Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 1 images









