Passed
Push — master ( 8b7e97...df5d30 )
by Grega
02:21
created

run_plba   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 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 ParameterFreeBatAlgorithm
9
10
from NiaPy.task import StoppingTask
11
from NiaPy.benchmarks import Sphere
12
13
algo = ParameterFreeBatAlgorithm()
14
15
for i in range(10):
16
	task = StoppingTask(D=10, nFES=10000, benchmark=Sphere(Upper=5.12, Lower=-5.12))
17
	best = algo.run(task)
18
	print('%s -> %s' % (best[0], best[1]))
19
print(algo.getParameters())
20