Skip to content

Commit

Permalink
Small formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MSallermann committed Mar 7, 2024
1 parent 6019543 commit f0ca287
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/models/ActivityDrivenModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void Seldon::ActivityAgentModel::update_network_probabilistic()
{
// Implement the weight for the probability of agent `idx_agent` contacting agent `j`
// Not normalised since this is taken care of by the reservoir sampling
auto weight_callback = [idx_agent, this]( size_t j ) {
auto weight_callback = [idx_agent, this]( size_t j )
{
if( idx_agent == j ) // The agent does not contact itself
return 0.0;
return std::pow(
Expand Down Expand Up @@ -126,7 +127,8 @@ void Seldon::ActivityAgentModel::update_network_mean()
contact_prob_list[idx_agent] = weights; // set to zero
}

auto probability_helper = []( double omega, size_t m ) {
auto probability_helper = []( double omega, size_t m )
{
double p = 0;
for( size_t i = 1; i <= m; i++ )
p += ( std::pow( -omega, i + 1 ) + omega ) / ( omega + 1 );
Expand All @@ -137,7 +139,8 @@ void Seldon::ActivityAgentModel::update_network_mean()
{
// Implement the weight for the probability of agent `idx_agent` contacting agent `j`
// Not normalised since this is taken care of by the reservoir sampling
auto weight_callback = [idx_agent, this]( size_t j ) {
auto weight_callback = [idx_agent, this]( size_t j )
{
constexpr double tolerance = 1e-16;
auto opinion_diff = std::abs( this->agents[idx_agent].data.opinion - this->agents[j].data.opinion );
if( opinion_diff < tolerance )
Expand Down
2 changes: 1 addition & 1 deletion src/simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Seldon::Simulation::Simulation(

fmt::print( "Using {} bots\n", model_activityDriven->n_bots );

auto bot_opinion = tbl["ActivityDriven"]["bot_opinion"];
auto bot_opinion = tbl["ActivityDriven"]["bot_opinion"];
auto bot_m = tbl["ActivityDriven"]["bot_m"];
auto bot_activity = tbl["ActivityDriven"]["bot_activity"];

Expand Down

0 comments on commit f0ca287

Please sign in to comment.