Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork495
Closed
Description
Passinggene_type=int in theGA class constructor, will result in internalnumpy arrays holding 64-bit integer values. This is well known to numpy users:
>>> type(numpy.array([1], dtype=int)[0])<class 'numpy.int64'>This, however, has two major problems:
- It contradicts the fact that Python
ints are arbitrary precision integers - It prohibits users from using
pygadto explore bigger state-spaces (e.g. bit-vectors of 256-bits, or even larger in my case)
To solve this problem, a one-liner fix is to addobject inGA.supported_int_typeshere. Then, users can passgene_type=object in theGA constructor and handle Python integers in objective functions without worrying aboutnumpy getting in their way.