Completed
Push — master ( 1ffd79...ed2fa1 )
by Grega
21s queued 13s
created

run_ts.logging_example()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 8
dl 0
loc 5
rs 10
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

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.other import TabuSearch
9
from NiaPy.task import StoppingTask
10
from NiaPy.benchmarks import Sphere
11
12
# we will run Sine Cosine Algorithm algorithm for 5 independent runs
13
for i in range(5):
14
    task = StoppingTask(D=10, nFES=10000, benchmark=Sphere())
15
    algo = TabuSearch(NP=30, a=7, Rmin=0.1, Rmax=3)
16
    best = algo.run(task=task)
17
    print(best)
18
19
# vim: tabstop=3 noexpandtab shiftwidth=3 softtabstop=3
20