Code Duplication    Length = 14-15 lines in 2 locations

NiaPy/algorithms/basic/cs.py 1 location

@@ 55-69 (lines=15) @@
52
    EDITED: TODO: Tests and validation! Bug in code.
53
    """
54
55
    def __init__(self, Np, D, nFES, Pa, Alpha, Lower, Upper, function):
56
        self.Np = Np
57
        self.D = D
58
        self.Pa = Pa
59
        self.Lower = Lower
60
        self.Upper = Upper
61
        self.Nests = []
62
        self.nFES = nFES
63
        self.FEs = 0
64
        self.Done = False
65
        self.Alpha = Alpha
66
        self.Beta = 1.5
67
        Cuckoo.FuncEval = staticmethod(function)
68
69
        self.gBest = Cuckoo(self.D, self.Lower, self.Upper)
70
71
    def evalNests(self):
72
        for c in self.Nests:

NiaPy/algorithms/modified/jde.py 1 location

@@ 50-63 (lines=14) @@
47
    IEEE transactions on evolutionary computation, 10(6), 646-657, 2006.
48
    """
49
50
    def __init__(self, D, NP, nFES, Lower, Upper, function):
51
        # TODO: check for F and CR parameters!
52
        self.D = D  # dimension of problem
53
        self.Np = NP  # population size
54
        self.nFES = nFES  # number of function evaluations
55
        self.Lower = Lower  # lower bound
56
        self.Upper = Upper  # upper bound
57
58
        SolutionjDE.FuncEval = staticmethod(function)
59
        self.Population = []
60
        self.FEs = 0
61
        self.Done = False
62
        self.bestSolution = SolutionjDE(self.D, Lower, Upper)
63
        self.Tao = None  # EDITED: check please
64
65
    def evalPopulation(self):
66
        for p in self.Population: