Generic Genetic Algorithm with sample and multithreading support