-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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])' | ||
|
||
|
||
|
@@ -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 | ||
|
@@ -64,7 +62,7 @@ | |
""" | ||
|
||
|
||
class BeeBase (object): | ||
class BeeBase (): | ||
def __init__(self, ProblemType, infile): | ||
random.seed() | ||
self.__solution_type = 0 | ||
|
@@ -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)) | ||
|