Skip to content

Commit

Permalink
fix: update remaining utils.poisson to distributions.poisson
Browse files Browse the repository at this point in the history
  • Loading branch information
s-bessey committed Dec 21, 2021
1 parent c503777 commit ad3e734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions titan/features/high_risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .. import agent
from .. import population
from .. import model
from ..distributions import poisson


class HighRisk(base_feature.BaseFeature):
Expand Down Expand Up @@ -170,7 +171,7 @@ def update_partner_numbers(self, pop: "population.Population", amount: int):
"""
for bond in self.agent.location.params.high_risk.partnership_types:
self.agent.mean_num_partners[bond] += amount # could be negative
self.agent.target_partners[bond] = utils.poisson(
self.agent.mean_num_partners[bond], pop.np_random
self.agent.target_partners[bond] = poisson(
pop.np_random, self.agent.mean_num_partners[bond]
)
pop.update_partnerability(self.agent)
2 changes: 1 addition & 1 deletion titan/interactions/injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_num_acts(cls, model: "model.TITAN", rel: "agent.Relationship") -> int:
min(agent_params.num_acts, partner_params.num_acts)
* model.calibration.injection.act
)
share_acts = poisson(mean_num_acts, model.np_random)
share_acts = poisson(model.np_random, mean_num_acts)

if share_acts < 1:
return 0
Expand Down

0 comments on commit ad3e734

Please sign in to comment.