Skip to content

Commit

Permalink
updating test..passing now,
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Feb 7, 2024
1 parent 1d5d961 commit 58e29b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sharkfin/tests/test_population_seed_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def train_pop(pop, parameter_dict):
pop.discrete_distributions = {}

pop.create_distributed_agents()

pop.create_database()
pop.solve_distributed_agents()

Expand All @@ -21,7 +22,6 @@ def train_pop(pop, parameter_dict):
pop.explode_agents(3)



def test_random_seeds():
LUCAS0['T_sim'] = 100

Expand All @@ -39,15 +39,19 @@ def test_random_seeds():
seed = 1776
)

train_pop(pop1, LUCAS0.copy())
train_pop(pop2, LUCAS0.copy())
train_pop(pop1, LUCAS0)
train_pop(pop2, LUCAS0)

p1a0 = pop1.agent_database["agents"][0]
p1a1 = pop1.agent_database["agents"][1]
p2a0 = pop1.agent_database["agents"][0]
p2a0 = pop2.agent_database["agents"][0]

### Different income seeds within one population
assert(p1a0.PermShkDstn.seed != p1a1.PermShkDstn.seed)

assert(pop1.seed != pop2.seed)

assert(p1a0.seed != p2a0.seed)

### Different income seeds across two populations with different seeds
assert(p1a0.PermShkDstn.seed != p2a0.PermShkDstn.seed)

0 comments on commit 58e29b8

Please sign in to comment.