Posted by ophir on June 13th, 2007
A few weeks ago Shawn Purtell from ROI Revolution wrote an excellent article on combining GWO with GA. If you haven’t read his article - please do so now. This posting describes a bug fix for his code, but you really should first read his article to fully understand how to use it.
I just found a bug in his code and am providing a fix for it. Under some circumstances, his code will provide the wrong combination number for the combination that is being displayed. Different combinations can be given the same combination number.
Please note: If you only have a single section on your page, Shawn’s code works fine as is.
To properly use the new getcombo function, you need to pass in a parameter. The parameter is a string with the number of variations in each section, seperated by dashes.
For example, if the first section has three variations, the second section has four variations and the third section has two variations you’d call the function as such:
If the first section has five variations and the second section has two variations, you’d call the function as such:
In order to allow a simple replacement of Shawn’s version, getcombo does not require a parameter. If you do not pass in any parameter, the function uses the same calculations as Shawn’s version, which did not require a parameter.
In order to get a better idea of how the bug can effect the combination number you get, I created a page that shows the different results you get from the old and the new versions of getcombo(). It lists all of the possible combinations for an experiment with two sections and between two and four variations for each section.
You can see the test page here.
Please let me know if you have any questions.