Aha! I think I understand you now.
You''re looking for some sort of automatic system that will take any given class, or part of a class, and create a chromosome to represent it, right? Or more specifically, create the functions and data that will represent it.
Basically, the problem you have is that while QT''s signals and slots are pretty standard across all classes, the representation you might want to use for GAs would change from situation to situation. You might have limits on what valid chromosomes are, you might want to choose normal binary or grey code, etc.
Probably the best way is to instead use some sort of template class which can take any basic type and encode it. You can use policy classes to specify the encoding methods etc. A generic encoding function could probably be written using sizeof() to make sure that you know how many bits you''re working with, although really you should use the constants in the numeric_limits class in the <limits> header.
Alternatively, have you looked at
GALib? It is "free for any use, commercial or otherwise" and might suit your needs as a lot of the functionality you may need is already there.
[
MSVC Fixes |
STL |
SDL |
Game AI |
Sockets |
C++ Faq Lite |
Boost |
Asking Questions |
Organising code files |
My stuff ]