Posted on: Saturday, October 19, 2019
Reading time: 1 minutes and 45 seconds.
This post is a simple implementation of Genetic Algorithm GA. Here, you would start with a random string and end up with the target string.
The web worker is often times cached for a longer period in production/live environments. Users would have a better experience if it is not required for them to do a hard refresh on the browsers. One easy way is to use the best practice to load the web worker in the head. Others suggested to versioning web-workers.
The web worker at times, does not like while loops. It would be better if for loops are used instead.
The cross over methodology for GA needs to be implemented with complexity in mind.
Using jQuery might not be the best idea as the hide() and show() which manipulates the display either changing to none or block does not work well on mobile browsers. Perhaps not using jQuery would be better.
Designing an encoding is very important. For example, in a knapsack problem there are only two choices. So, each item can either be true or false.