correct plotting weight
@@ -481,12 +481,12 @@ def plot_people(people, bins=None, width=1.0, font_size=18, alpha=0.6, fig_args=
title = f'Total contacts for layer "{lk}": {total_contacts:n}'
elif w_type == 'percapita':
weight = np.divide(1.0, age_counts, where=age_counts>0)
- mean_contacts = 2*len(people.contacts[lk])/len(people)
+ mean_contacts = 2*len(people.contacts[lk])/len(people) # Factor of 2 since edges are bi-directional
ylabel = 'Per capita number of contacts'
title = f'Mean contacts for layer "{lk}": {mean_contacts:0.2f}'
elif w_type == 'weighted':
weight = people.pars['beta_layer'][lk]*people.pars['beta']
- total_weight = np.round(weight*len(people.contacts[lk]))
+ total_weight = np.round(weight*2*len(people.contacts[lk]))
ylabel = 'Weighted number of contacts'
title = f'Total weight for layer "{lk}": {total_weight:n}'
