Skip to content

Commit 6b9fff1

Browse files
authored
Merge pull request #742 from musicinmybrain/spurious-exec
Tidy up some minutiae in the examples
2 parents 09ca9ac + a13d955 commit 6b9fff1

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

examples/run_all.sh

100755100644
File mode changed.

examples/run_loa.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
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-
6-
sys.path.append('../')
7-
# End of fix
8-
9-
from niapy.algorithms.basic import LionOptimizationAlgorithm
10-
from niapy.task import Task
11-
from niapy.problems import Sphere
12-
13-
# we will run Lion Optimization Algorithm for 5 independent runs
14-
for i in range(5):
15-
task = Task(problem=Sphere(dimension=10), max_evals=10000)
16-
algo = LionOptimizationAlgorithm(population_size=40)
17-
best = algo.run(task)
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+
6+
sys.path.append('../')
7+
# End of fix
8+
9+
from niapy.algorithms.basic import LionOptimizationAlgorithm
10+
from niapy.task import Task
11+
from niapy.problems import Sphere
12+
13+
# we will run Lion Optimization Algorithm for 5 independent runs
14+
for i in range(5):
15+
task = Task(problem=Sphere(dimension=10), max_evals=10000)
16+
algo = LionOptimizationAlgorithm(population_size=40)
17+
best = algo.run(task)
1818
print(best)

0 commit comments

Comments
 (0)