| Total Complexity | 0 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # encoding=utf8 |
||
| 2 | # This is temporary fix to import module from parent folder |
||
| 3 | # It will be removed when package is published on PyPI |
||
| 4 | import sys |
||
| 5 | sys.path.append('../') |
||
| 6 | # End of fix |
||
| 7 | |||
| 8 | from NiaPy.algorithms.modified import AdaptiveBatAlgorithm |
||
| 9 | from NiaPy.task import StoppingTask |
||
| 10 | from NiaPy.benchmarks import Griewank |
||
| 11 | |||
| 12 | # we will run Bat Algorithm for 5 independent runs |
||
| 13 | algo = AdaptiveBatAlgorithm() |
||
| 14 | for i in range(5): |
||
| 15 | task = StoppingTask(D=10, nGEN=10000, benchmark=Griewank(Lower=-600, Upper=600)) |
||
| 16 | best = algo.run(task) |
||
| 17 | print('%s -> %s' % (best[0], best[1])) |
||
| 18 | print(algo.getParameters()) |
||
| 19 | |||
| 20 |