@@ -43,12 +43,12 @@ ScalarType total_exposure_by_contacts(const ContactExposureRates& rates, const C
4343 age_receiver_group_size > 1 ) // adjust for the person not meeting themself
4444 {
4545 total_exposure += rates[{cell_index, virus, age_transmitter}] *
46- params.get <ContactRates>()[{ age_receiver, age_transmitter}] * age_receiver_group_size /
47- (age_receiver_group_size - 1 );
46+ params.get <ContactRates>(). get_baseline ()( age_receiver. get () , age_transmitter. get ()) *
47+ age_receiver_group_size / (age_receiver_group_size - 1 );
4848 }
4949 else {
5050 total_exposure += rates[{cell_index, virus, age_transmitter}] *
51- params.get <ContactRates>()[{ age_receiver, age_transmitter}] ;
51+ params.get <ContactRates>(). get_baseline ()( age_receiver. get () , age_transmitter. get ()) ;
5252 }
5353 }
5454 return total_exposure;
@@ -189,12 +189,15 @@ void adjust_contact_rates(Location& location, size_t num_agegroups)
189189 ScalarType total_contacts = 0 .;
190190 // slizing would be preferred but is problematic since both Tags of ContactRates are AgeGroup
191191 for (auto contact_to = AgeGroup (0 ); contact_to < AgeGroup (num_agegroups); contact_to++) {
192- total_contacts += location.get_infection_parameters ().get <ContactRates>()[{contact_from, contact_to}];
192+ total_contacts += location.get_infection_parameters ().get <ContactRates>().get_baseline ()(contact_from.get (),
193+ contact_to.get ());
193194 }
194195 if (total_contacts > location.get_infection_parameters ().get <MaximumContacts>()) {
195196 for (auto contact_to = AgeGroup (0 ); contact_to < AgeGroup (num_agegroups); contact_to++) {
196- location.get_infection_parameters ().get <ContactRates>()[{contact_from, contact_to}] =
197- location.get_infection_parameters ().get <ContactRates>()[{contact_from, contact_to}] *
197+ location.get_infection_parameters ().get <ContactRates>().get_baseline ()(contact_from.get (),
198+ contact_to.get ()) =
199+ location.get_infection_parameters ().get <ContactRates>().get_baseline ()(contact_from.get (),
200+ contact_to.get ()) *
198201 location.get_infection_parameters ().get <MaximumContacts>() / total_contacts;
199202 }
200203 }
0 commit comments