We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d1b80a2 + 17d400b commit f919fe3Copy full SHA for f919fe3
1 file changed
geatpy/optimize.py
@@ -93,7 +93,7 @@ def optimize(algorithm,
93
prophetPop = ea.Population(algorithm.population.Encoding, algorithm.population.Field, 1, ea.ri2bs(prophet, algorithm.population.Field))
94
else:
95
raise RuntimeError('error in optimize: The encoding should be ''RI'', ''P'' or ''BG''. (种群编码必须为''RI'', ''P'' 或 ''BG''。)')
96
- elif type(prophet) == ea.Population:
+ elif isinstance(prophet, ea.Population):
97
prophetPop = prophet.copy()
98
99
raise RuntimeError('error in optimize: The type of prophet must be Numpy ndarray or Population. (prophet的类型必须为Numpy ndarray数组或种群类。)')
0 commit comments