Skip to content

Commit

Permalink
Fixed undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniogi committed Sep 30, 2024
1 parent 5665ea7 commit bb9e95b
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/SolverDAB.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
# limitations under the License. #
#############################################################################

from mpi4py import MPI
import sys
import random
import shutil
import time
from array import array
from SolverBase import SolverBase
from ProblemFusion import ProblemFusion
from ProblemNonSeparable import ProblemNonSeparable
from SolutionFusion import SolutionFusion
from SolutionNonSeparable import SolutionNonSeparable
import Utils as u
import configparser
import SolutionsQueue as solQueue

__author__ = ' AUTHORS: Antonio Gomez ([email protected])'


Expand All @@ -36,23 +51,6 @@
there is something else to be done.
"""

from mpi4py import MPI

import sys
import random
import shutil
import time

from SolverBase import SolverBase
from ProblemFusion import ProblemFusion
from ProblemNonSeparable import ProblemNonSeparable
from SolutionFusion import SolutionFusion
from SolutionNonSeparable import SolutionNonSeparable
import Utils as u
import configparser
import SolutionsQueue as solQueue

from array import array

"""
Base class for bees
Expand All @@ -64,7 +62,7 @@
"""


class BeeBase (object):
class BeeBase ():
def __init__(self, ProblemType, infile):
random.seed()
self.__solution_type = 0
Expand Down Expand Up @@ -479,16 +477,16 @@ def __init__(self, problem_type, infile, configfile):

SolverBase.__init__(self, problem_type, infile, configfile)
self.__bestSolution = None
self.__globalBestSolution = None
self.__bestGlobalSolution = None

if (self.__problem_type == u.problem_type.FUSION):
self.__problem = ProblemFusion()
self.__bestSolution = SolutionFusion(self.__infile)
self.__globalBestSolution = SolutionFusion(self.__infile)
self.__bestGlobalSolution = SolutionFusion(self.__infile)
elif (self.__problem_type == u.problem_type.NONSEPARABLE):
self.__problem = ProblemNonSeparable()
self.__bestSolution = SolutionNonSeparable(self.__infile)
self.__globalBestSolution = SolutionNonSeparable(self.__infile)
self.__bestGlobalSolution = SolutionNonSeparable(self.__infile)
else:
u.logger.critical("SolverDAB (" + str(sys.exc_info()[2].tb_lineno) +
"). Unknown problem type " + str(problem_type))
Expand Down

0 comments on commit bb9e95b

Please sign in to comment.