Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
GregaVrbancic committed Jun 13, 2018
2 parents d54eeff + 9e72485 commit b8676ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/run_fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
sys.path.append('../')
# End of fix

import random
import logging
from NiaPy.algorithms.basic import FireflyAlgorithm

logging.basicConfig()
logger = logging.getLogger('examples')
logger.setLevel('INFO')

# For reproducive results
random.seed(1234)


class MyBenchmark(object):
def __init__(self):
Expand All @@ -25,10 +29,9 @@ def evaluate(D, sol):
return val
return evaluate

for i in range(10):

Algorithm = FireflyAlgorithm(
10, 20, 10000, 0.5, 0.2, 1.0, MyBenchmark())
for i in range(10):
Algorithm = FireflyAlgorithm(10, 20, 10000, 0.5, 0.2, 1.0, MyBenchmark())
Best = Algorithm.run()

logger.info(Best)

0 comments on commit b8676ba

Please sign in to comment.