def nr_of_models_alive(self, t=None) -> int:
"""
Number of models still alive.
Parameters
----------
t: int
Population number
Returns
-------
nr_alive: int >= 0 or None
Number of models still alive.
None is for the last population
"""
if t is None:
t = self.max_t
else:
t = int(t)
model_probs = self.get_model_probabilities(t)
return int((model_probs.p > 0).sum())
评论列表
文章目录