-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle recursive data structures #7
Comments
We can think about it, but I still cannot understand in which cases our current solution does not work. |
@dardin88 It doesn't work with the example in the original post. At the moment, it doesn't work for sure if there is a recursive data structure (e.g., linked list). Actually, we don't handle pointers to structures properly, I would say, we just handle pointers to native types. If we have a pointer to a structure, we treat it as a normal structure and we linearize it to represent it in the chromosome, and all the fields of the structure are (i) represented as numbers in the chromosome, if they are native types/pointers or (ii) further linearized if they are structures (note that pointers to structures belong to the first category). For example, consider a struct If there is a function EDIT: note that, in the original post, "array_x" are always arrays of numbers. |
OCELOT does not work with recursive data structures. For example:
The main problem here is defining a chromosome representation GAs and other algorithms and to define a procedure to dynamically translate the chromosome in variables that should be passed to the function.
The solution should work also in a scenario similar to this:
At the moment, we linearize the structures, and this prevents us to handle this kind of case. Our chromosome representation is the following:
Where n is the number of byval parameters, m is the number of reference parameters and k is the maximum size of the array, defined as a test-case generation parameter.
We should devise a new generic, nonlinear chromosome representation.
Any ideas?
The text was updated successfully, but these errors were encountered: