Interface PersonHistory

All Superinterfaces:
Abstraction.TemporalState<Person>, PersonTemporalState, Serializable
All Known Implementing Classes:
ImmutablePersonHistory

@Immutable public interface PersonHistory extends PersonTemporalState
Historical patient data relevant to the ongoing simulation. Some of this is copied from the patients state, and some is updated by patient behaviour. Notably this is where contacts, and testing is stored as the history of both are needed. The simulation stores enough history for an individual to inform the current state (in terms of
  • Method Details

    • getTodaysTests

      List<TestResult> getTodaysTests()
      The list of tests taken on this day. Initially the result will be marked as PENDING until the test is processed. (the true result is available internally to the model immediately, but not necessarily observed).
    • getTodaysContacts

      Contact[] getTodaysContacts()
      A list of contacts made in this time period and their weight from the perspective of transmission (i.e. context). Weights might be less if for example the participants are wearing masks. In the future we might build contact venue into this context.
      Returns:
    • getTodaysExposures

      Exposure[] getTodaysExposures()
      A list of exposures made in this time period. These are contacts who are infectious.
    • getPrevious

      default Optional<PersonHistory> getPrevious()
    • getNext

      default Optional<PersonHistory> getNext()
    • getPrevious

      default Stream<PersonHistory> getPrevious(int limit)
    • getInfector

      @Deprecated @Lazy default Optional<PersonHistory> getInfector()
      Deprecated.
      For a new infection this finds the contact with maximal viral exposure on the first day before the subject is infectious when the subject was exposed by an "infector". From this "infector" the time of their infection is identified so that all the infections from one infector should map back to the same instant in time for that infector.
      Returns:
    • getInfectiousContact

      @Deprecated @Lazy default Optional<Exposure> getInfectiousContact()
      Deprecated.
      For a new infection this finds the contact with maximal viral exposure on the first day before the subject is infectious when the subject was exposed by an "infector". From this "infector" the time of their infection is identified so that all the infections from one infector should map back to the same instant in time for that infector.
      Returns:
    • getInfectionStart

      @Lazy @Deprecated default Optional<PersonHistory> getInfectionStart()
      Deprecated.
      If person is infected here find the infectee state at the point in time they became infectious.
    • getNewInfection

      @Deprecated @Lazy default Optional<PersonHistory> getNewInfection()
      Deprecated.
      Find if a person is newly infectious on this day. This is not the same as being newly exposed.
      Returns:
    • isIncidentExposure

      @Lazy default boolean isIncidentExposure()
      Is this person newly exposed on this day? defined as the first time a non zero exposure is recorded within one infectious period.
      Returns:
    • isIncidentInfection

      @Lazy default boolean isIncidentInfection()
      Is this person newly infectious on this day.
      Returns:
    • isIncidentHospitalisation

      @Lazy default boolean isIncidentHospitalisation()
      Is this person newly needing hospitalisation on this day, or is this part of the same infection episode (as defined by the average duration of symptoms.
      Returns:
    • getLastExposure

      default Optional<PersonHistory> getLastExposure()
      Find the infectee's state at the start of last episode of exposure to virus, I.e. the first in a run of exposures, which are separated by less that one infectious period.
    • getHistoricalTests

      default Stream<TestResult> getHistoricalTests(int limit)
    • getStillRelevantTests

      default Stream<TestResult> getStillRelevantTests()
      All the tests done in the last presumed infectious period
    • getResults

      @Lazy default List<TestResult> getResults()
      The collection of possibly still relevant test results for an individual that generate a result on this day, regardless of when they were taken. This does look backwards over all possibly relevant tests, there is possibility that some tests that take a very long time to process compared to the infectious period will not get picked up by this logic and we may have to revisit
    • getHistoricalContacts

      default Stream<Contact> getHistoricalContacts(int limit)
    • getStillRelevantContacts

      default Stream<Contact> getStillRelevantContacts()
      All the contacts in the last presumed infectious period
    • getResultsBySampleDate

      default Stream<TestResult> getResultsBySampleDate(int time)
    • getMaxDelay

      @Derived default int getMaxDelay()
      The maximum delay for test results for this individual is used when we assemble the forward looking list of test results on a per day basis. i.e. the list of results organised by sample date as they would appear on the release date, including delay distribution.
    • getResultsBySampleDate

      @Lazy default List<List<TestResult>> getResultsBySampleDate()
      The list of tests taken on this day, indexed by the delay until the results are available.