Update main.py

This commit is contained in:
Namhyeon Go 2021-04-04 11:38:21 +09:00 committed by GitHub
parent 89c76c8d85
commit 136d6a72ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
main.py
View File

@ -42,10 +42,19 @@ model = ga(function=f, dimension=3, variable_type='int', variable_boundaries=var
model.run()
solution = model.output_dict
variable = model.output_dict['variable']
_variables = model.output_dict['last_generation']['variables']
variable = solution['variable']
variables = [list(item) for item in set(tuple(x) for x in _variables)]
_x = max([row[0] for row in rows]) + 1 # get highest number
print ('Recommended numbers (' + str(_x) + 'th):')
print()
print ('Best matched numbers (' + str(_x) + 'th):')
nums = sorted([make_num(_x, n, variable[0], variable[1], variable[2], 1, 45) for n in range(1, 7)]) # excluded bonus number
print(', '.join(str(x) for x in nums))
print()
print ('Recommended numbers (' + str(_x) + 'th):')
for variable in variables:
nums = sorted([make_num(_x, n, variable[0], variable[1], variable[2], 1, 45) for n in range(1, 7)]) # excluded bonus number
print(', '.join(str(x) for x in nums))