Ejemplo n.º 1
0
 def _update_old(self, prosp):
     mortality_men = Utils.saturate(self._mortality["old-men"] * Utils.opposite(prosp), 1.0)
     mortality_women = Utils.saturate(self._mortality["old-women"] * Utils.opposite(prosp), 1.0)
     n_old_men = self._old_men
     n_old_women = self._old_women
     [m_dead, m_alive] = Utils.rsplit(n_old_men, mortality_men)
     [w_dead, w_alive] = Utils.rsplit(n_old_women, mortality_women)
     # print("Dead old men: " + str(m_dead) + " dead old women: " + str(w_dead))
     return [0, 0, 0, -m_dead, -w_dead]
Ejemplo n.º 2
0
 def _update_young(self, prosp):
     mortality_men = self._mortality["young-men"] * Utils.opposite(prosp)
     mortality_women = self._mortality["young-women"] * Utils.opposite(prosp)
     n_young_men = self._young_men
     n_young_women = self._young_women
     [m_dead, m_alive] = Utils.rsplit(n_young_men, mortality_men)
     [w_dead, w_alive] = Utils.rsplit(n_young_women, mortality_women)
     [m_grown, m_rest] = Utils.rsplit(m_alive, self._grown_rates["old-men"])
     [w_grown, w_rest] = Utils.rsplit(w_alive, self._grown_rates["old-women"])
     # print("Dead young men: " + str(m_dead) + " dead young women: " + str(w_dead))
     return [0, -1 * (m_dead + m_grown), -1 * (w_dead + w_grown), m_grown, w_grown]
Ejemplo n.º 3
0
 def _update_children(self, prosp):
     mortality = self._mortality["children"] * Utils.opposite(prosp)
     n_children = self._children
     [dead, grown] = Utils.rsplit(n_children, mortality)
     [men, women] = Utils.rsplit(grown, self._grown_rates["men-women"])
     # print("Dead children: " + str(dead))
     return [-dead, men, women, 0, 0]