Skip to content

Commit

Permalink
mean-field-theory: Fixed segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
amritagos committed Oct 30, 2023
1 parent 6d46498 commit d26c07d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/ActivityDrivenModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Seldon::ActivityAgentModel::ActivityAgentModel( int n_agents, Network & network, std::mt19937 & gen )
: Model<Seldon::ActivityAgentModel::AgentT>( n_agents ),
network( network ),
contact_prob_list( std::vector<std::vector<Network::WeightT>>() ),
contact_prob_list( std::vector<std::vector<Network::WeightT>>( n_agents ) ),
gen( gen )
{
}
Expand Down Expand Up @@ -148,7 +148,10 @@ void Seldon::ActivityAgentModel::update_network_mean()
// Update contact prob_list (outgoing)
contact_prob_list[idx_agent][j] = probability_helper( omega, m );
}
}

for( size_t idx_agent = 0; idx_agent < network.n_agents(); idx_agent++ )
{
// Calculate the actual weights and reciprocity
for( size_t j = 0; j < network.n_agents(); j++ )
{
Expand Down

0 comments on commit d26c07d

Please sign in to comment.