6.2 CHANGES ON JGDS v3.5 CLASSES |
The main problem is that, in RND problem, we only use 100 transmitters, but in RND2 problem we have to take 149. So, now, we have chromosomes of 149 bits (1 for gene length multiplied by 149 for the number of genes), where each gene represents a transmitter, and it indicates if the transmitter is part or not of the solution. The transmitters will be placed on a grid of 287x287, where each one has a covering cell of 41x41. We will place in a regular way 49 transmitters so that they cover all the grid, and the other 100 will be placed on aleatoty positions in the grid. All these positions are already fixed inside the problem, that is, inside the class RND2, we have a list of 149 couples and they indicate the positions of each transmitter. Contrary to the previous implementation, now each island is going to work with the same problem, because all the transmitters are placed, at the beginning of the problem, in the same position. In the previous version we could only work with a grid of a maximum size of 127 bits, this is because the variable that contains the value, SIDE_LENGTH, was defined as byte. This type allows a maximum of 8 bits for numerical representations. But in Java all the types are signed, so, it reserves a bit for the sign. We only could use 7 of those 8 bits to represent numbers and, as maximum, we could represent (2^7) - 1 = 127. But in this new version we have assigned to SIDE_LENGTH a short variable that can use 16 bits and it can represent the size of the grid (287) . Modifications realized on the class Island.
Modifications realized on the class Problem.
As we have seen, the other classes don't suffer many modifications, only the relatives to the managing of the variable SIDE_LENGTH, in the change of type, and in the call to the RND problem, that we have to change it into the RND2.
|