Completed
Push — master ( d65b72...3136a0 )
by
unknown
25s queued 10s
created

run_bea   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 19
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
from NiaPy.benchmarks import Sphere
5
from NiaPy.task.task import StoppingTask, OptimizationType
6
from NiaPy.algorithms.basic import BeesAlgorithm
7
8
import sys
9
sys.path.append('../')
10
# End of fix
11
12
13
# we will run Bees Algorithm for 5 independent runs
14
for i in range(5):
15
    task = StoppingTask(D=20, nGEN=2, optType=OptimizationType.MINIMIZATION, benchmark=Sphere())
16
    algo = BeesAlgorithm(NP=50, m=20, e=10, nep=20, nsp=15, ngh=7)
17
    best = algo.run(task=task)
18
    print('%s -> %s' % (best[0], best[1]))
19