Skip to content

Commit

Permalink
Merge branch 'bugfix/precise_activity_CO2' into 'master'
Browse files Browse the repository at this point in the history
Fixed bug on precise activity

See merge request caimira/caimira!467
  • Loading branch information
lrdossan committed Oct 20, 2023
2 parents 4a5fee9 + bb0bceb commit 628e517
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion caimira/apps/calculator/model_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,15 @@ def build_CO2_model(self, sample_size=DEFAULT_MC_SAMPLE_SIZE) -> models.CO2Conce
total_people = [infected_population.people_present(stop) + exposed_population.people_present(stop)
for _, stop in zip(transition_times[:-1], transition_times[1:])]

if (self.activity_type == 'precise'):
activity_defn, _ = self.generate_precise_activity_expiration()
else:
activity_defn = ACTIVITIES[ACTIVITY_TYPES.index(self.activity_type)]['activity']

population = mc.SimplePopulation(
number=models.IntPiecewiseConstant(transition_times=tuple(transition_times), values=tuple(total_people)),
presence=None,
activity=activity_distributions[ACTIVITIES[ACTIVITY_TYPES.index(self.activity_type)]['activity']],
activity=activity_distributions[activity_defn],
)

# Builds a CO2 concentration model based on model inputs
Expand Down

0 comments on commit 628e517

Please sign in to comment.