From ffedbbaedf20207a50bc2e8a8347da75ee71da77 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 6 May 2023 20:12:43 -0700 Subject: [PATCH] import solution.py from evolopy and use it --- evolopy/BAT.py | 2 +- evolopy/CS.py | 2 +- evolopy/DE.py | 2 +- evolopy/FFA.py | 2 +- evolopy/GA.py | 2 +- evolopy/GWO.py | 2 +- evolopy/HHO.py | 2 +- evolopy/JAYA.py | 2 +- evolopy/MFO.py | 2 +- evolopy/MVO.py | 2 +- evolopy/PSO.py | 2 +- evolopy/SCA.py | 2 +- evolopy/SSA.py | 2 +- evolopy/WOA.py | 2 +- evolopy/solution.py | 23 +++++++++++++++++++++++ 15 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 evolopy/solution.py diff --git a/evolopy/BAT.py b/evolopy/BAT.py index e51430f..2cae7e6 100644 --- a/evolopy/BAT.py +++ b/evolopy/BAT.py @@ -8,7 +8,7 @@ import math import numpy import random import time -from solution import solution +from .solution import solution def BAT(objf, lb, ub, dim, N, Max_iteration): diff --git a/evolopy/CS.py b/evolopy/CS.py index 09efe59..da17776 100644 --- a/evolopy/CS.py +++ b/evolopy/CS.py @@ -8,7 +8,7 @@ import math import numpy import random import time -from solution import solution +from .solution import solution def get_cuckoos(nest, best, lb, ub, n, dim): diff --git a/evolopy/DE.py b/evolopy/DE.py index bc206e2..ce1871a 100644 --- a/evolopy/DE.py +++ b/evolopy/DE.py @@ -1,7 +1,7 @@ import random import numpy import time -from solution import solution +from .solution import solution # Differential Evolution (DE) diff --git a/evolopy/FFA.py b/evolopy/FFA.py index 3a87ac8..02d2bf3 100644 --- a/evolopy/FFA.py +++ b/evolopy/FFA.py @@ -20,7 +20,7 @@ Created on Sun May 29 00:49:35 2016 import numpy import math import time -from solution import solution +from .solution import solution def alpha_new(alpha, NGen): diff --git a/evolopy/GA.py b/evolopy/GA.py index 485b140..3a6b8c7 100644 --- a/evolopy/GA.py +++ b/evolopy/GA.py @@ -8,7 +8,7 @@ import random import time import sys -from solution import solution +from .solution import solution def crossoverPopulaton(population, scores, popSize, crossoverProbability, keep): diff --git a/evolopy/GWO.py b/evolopy/GWO.py index 4aee47b..acb9cb4 100644 --- a/evolopy/GWO.py +++ b/evolopy/GWO.py @@ -8,7 +8,7 @@ Created on Mon May 16 00:27:50 2016 import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/HHO.py b/evolopy/HHO.py index 9b37af8..d140e21 100644 --- a/evolopy/HHO.py +++ b/evolopy/HHO.py @@ -15,7 +15,7 @@ Created on Thirsday March 21 2019 import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/JAYA.py b/evolopy/JAYA.py index 84c0536..619797c 100644 --- a/evolopy/JAYA.py +++ b/evolopy/JAYA.py @@ -3,7 +3,7 @@ import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/MFO.py b/evolopy/MFO.py index 4f8248e..4bf8c18 100644 --- a/evolopy/MFO.py +++ b/evolopy/MFO.py @@ -8,7 +8,7 @@ Created on Mon May 16 10:42:18 2016 import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/MVO.py b/evolopy/MVO.py index ff2be99..1029705 100644 --- a/evolopy/MVO.py +++ b/evolopy/MVO.py @@ -11,7 +11,7 @@ import math import sklearn from numpy import asarray from sklearn.preprocessing import normalize -from solution import solution +from .solution import solution def normr(Mat): diff --git a/evolopy/PSO.py b/evolopy/PSO.py index 34876bf..7668b60 100644 --- a/evolopy/PSO.py +++ b/evolopy/PSO.py @@ -7,7 +7,7 @@ Created on Sun May 15 22:37:00 2016 import random import numpy -from solution import solution +from .solution import solution import time diff --git a/evolopy/SCA.py b/evolopy/SCA.py index 2011c74..98ac53e 100644 --- a/evolopy/SCA.py +++ b/evolopy/SCA.py @@ -3,7 +3,7 @@ import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/SSA.py b/evolopy/SSA.py index 8b880fe..d795649 100644 --- a/evolopy/SSA.py +++ b/evolopy/SSA.py @@ -1,7 +1,7 @@ import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/WOA.py b/evolopy/WOA.py index 8f784ef..ca7783c 100644 --- a/evolopy/WOA.py +++ b/evolopy/WOA.py @@ -7,7 +7,7 @@ Created on Mon May 16 14:19:49 2016 import random import numpy import math -from solution import solution +from .solution import solution import time diff --git a/evolopy/solution.py b/evolopy/solution.py new file mode 100644 index 0000000..3e4cccf --- /dev/null +++ b/evolopy/solution.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue May 17 17:06:19 2016 + +@author: Hossam Faris +""" + + +class solution: + def __init__(self): + self.best = 0 + self.bestIndividual = [] + self.convergence = [] + self.optimizer = "" + self.objfname = "" + self.startTime = 0 + self.endTime = 0 + self.executionTime = 0 + self.lb = 0 + self.ub = 0 + self.dim = 0 + self.popnum = 0 + self.maxiers = 0