Passed
Push — master ( 7a896d...029ae0 )
by Grega
01:03
created

run_mbo   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
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.util import StoppingTask, OptimizationType
6
from NiaPy.algorithms.basic import MonarchButterflyOptimization
7
import random
8
import sys
9
sys.path.append('../')
10
# End of fix
11
12
13
# we will run Forest Optimization Algorithm for 5 independent runs
14
for i in range(5):
15
    task = StoppingTask(D=10, nFES=100000, optType=OptimizationType.MINIMIZATION, benchmark=Sphere())
16
    algo = MonarchButterflyOptimization(NP=50)
17
    best = algo.run(task=task)
18
    print(best)
19