Skip to content

Commit f919fe3

Browse files
authored
Merge pull request #398 from WhiskyChoy/patch-1
Fix subtype/subclass miss branch issue
2 parents d1b80a2 + 17d400b commit f919fe3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

geatpy/optimize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def optimize(algorithm,
9393
prophetPop = ea.Population(algorithm.population.Encoding, algorithm.population.Field, 1, ea.ri2bs(prophet, algorithm.population.Field))
9494
else:
9595
raise RuntimeError('error in optimize: The encoding should be ''RI'', ''P'' or ''BG''. (种群编码必须为''RI'', ''P'' 或 ''BG''。)')
96-
elif type(prophet) == ea.Population:
96+
elif isinstance(prophet, ea.Population):
9797
prophetPop = prophet.copy()
9898
else:
9999
raise RuntimeError('error in optimize: The type of prophet must be Numpy ndarray or Population. (prophet的类型必须为Numpy ndarray数组或种群类。)')

0 commit comments

Comments
 (0)