Skip to content

The integer example gives an error #1

@dicotom

Description

@dicotom

Set: Average time of function evaluating (secs): 9.984970092773438e-06 (total = 0.0009984970092773438)

Best score before optimization: 3.0

____________________ 1.1% GA is running...1 gen from 90...best value = 3.0Traceback (most recent call last):
File "N:/DOWNLOADS/Roi Polanitzer GIT HUB LOTTERY FILES/LOTTERY PREDICTIONS/lotto_genetic_algorithm-main/example2.py", line 13, in
model.run(function=f)
File "C:\Python312\Lib\site-packages\geneticalgorithm2\geneticalgorithm2.py", line 1056, in run
ch2 = self.mut_middle(ch2, pvar1, pvar2)
File "C:\Python312\Lib\site-packages\geneticalgorithm2\geneticalgorithm2.py", line 1186, in mut_middle
x[i] = random.randint(v2, v1)
File "C:\Python312\Lib\random.py", line 336, in randint
return self.randrange(a, b+1)
File "C:\Python312\Lib\random.py", line 301, in randrange
istart = _index(start)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions