File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments