Skip to content

Commit

Permalink
Merge pull request #139 from rhododendrom/patch-1
Browse files Browse the repository at this point in the history
Update run_abc.py
  • Loading branch information
GregaVrbancic committed Jun 13, 2018
2 parents 9e72485 + b8676ba commit ed52e7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/run_abc.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
from __future__ import print_function
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
# End of fix

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

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

# For reproducive results
random.seed(1234)


class MyBenchmark(object):
def __init__(self):
Expand All @@ -27,4 +34,4 @@ def evaluate(D, sol):
Algorithm = ArtificialBeeColonyAlgorithm(10, 40, 10000, MyBenchmark())
Best = Algorithm.run()

print(Best)
logger.info(Best)

0 comments on commit ed52e7e

Please sign in to comment.