DatalogiForAlle / AgentsPy

Agent-based simulation for education in Python
GNU General Public License v3.0
5 stars 0 forks source link

epidemic.py: Agents shouldn't update model parameters #86

Open dybber opened 3 years ago

dybber commented 3 years ago

The agents shouldn't be responsible for updating model parameters, such as

        model.infected -= 1
        model.immune += 1

Instead these aggregates should be calculated by the model itself, e.g. when needed for the bar plot.

Instead, a Person-object should have a state variable, e.g. self.state, which starts out as "NORMAL", changes to "INFECTED", to "IMMUNE"