InitialInfectionHandler.java

  1. package org.matsim.episim.model;

  2. import it.unimi.dsi.fastutil.objects.Object2IntMap;
  3. import org.matsim.api.core.v01.Id;
  4. import org.matsim.api.core.v01.population.Person;
  5. import org.matsim.episim.EpisimPerson;

  6. import java.util.Map;

  7. /**
  8.  * Class that is responsible for modelling disease import and initial infections.
  9.  */
  10. public interface InitialInfectionHandler {

  11.     /**
  12.      * Called at the start of every iteration. This class should set the disease state of persons as necessary.
  13.      * @return number of people infected
  14.      */
  15.     Object2IntMap<VirusStrain> handleInfections(Map<Id<Person>, EpisimPerson> persons, int iteration);

  16.     /**
  17.      * Number of initial infections left that will also be persisted. Might be relevant for certain models to stop disease import.
  18.      */
  19.     default int getInfectionsLeft() {
  20.         return 0;
  21.     }

  22.     /**
  23.      * Set the number of initial infections left.
  24.      */
  25.     default void setInfectionsLeft(int num) {}
  26. }