Skip to content

Commit 95f2354

Browse files
authored
Add files via upload
1 parent aa72c74 commit 95f2354

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

algorithm/Dlba.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def __init__(self, configuration, numberOfCrossoverPoints=2, mutationSize=2, cro
2020
super().__init__(configuration, numberOfCrossoverPoints, mutationSize, crossoverProbability,
2121
mutationProbability)
2222

23+
# there should be at least 5 chromosomes in population
24+
if self._populationSize < 5:
25+
self._populationSize = 5
26+
2327
self._chromlen, self._minValue, self._alpha, self._pa = 0, 0, .9, .25
2428
self._loudness, self._rate = None, None
2529

algorithm/Fpa.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def __init__(self, configuration, numberOfCrossoverPoints=2, mutationSize=2, cro
1919
super().__init__(configuration, numberOfCrossoverPoints, mutationSize, crossoverProbability,
2020
mutationProbability)
2121

22+
# there should be at least 5 chromosomes in population
23+
if self._populationSize < 5:
24+
self._populationSize = 5
25+
2226
self._chromlen, self._pa = 0, .25
2327

2428
self._lf, self._gBest = None, None

0 commit comments

Comments
 (0)