Code Duplication    Length = 5-5 lines in 2 locations

NiaPy/algorithms/basic/de.py 1 location

@@ 105-109 (lines=5) @@
102
    def generationStep(self, Population):
103
        """Implement main generation step."""
104
105
        newPopulation = []
106
        for i in range(self.Np):
107
            newSolution = SolutionDE(self.D, self.Lower, self.Upper)
108
109
            r = rnd.sample(range(0, self.Np), 3)
110
            while i in r:
111
                r = rnd.sample(range(0, self.Np), 3)
112
            jrand = int(rnd.random() * self.Np)

NiaPy/algorithms/modified/jde.py 1 location

@@ 99-103 (lines=5) @@
96
        self.Done = False
97
        self.bestSolution = SolutionjDE(
98
            self.D,
99
            self.Lower,
100
            self.Upper,
101
            self.F,
102
            self.CR)
103
104
    def evalPopulation(self):
105
        """Evaluate population."""
106