For many problems one needs to optimize vectors or integers (from N1 to N2). I tried with many methods by casting the variables to integer e.g. (int) a->x[0]; for the objective function but using GA for example most value end-up becoming close to zero ... any suggestions ? For binaries variables I would try variables from 0.0 to 1.0 and taking 0.5 as threshold for 0 or 1.