sir.util
Class Event

java.lang.Object
  extended bysir.util.Event
All Implemented Interfaces:
java.util.Comparator

public class Event
extends java.lang.Object
implements java.util.Comparator

Title: SIREstimate Description: Estimation of SIR parameters Copyright: Copyright (c) 2002 Company:

Version:
1.0 Added Stuff in order to compare two events to each other.
Author:
Michael Höhle

Field Summary
 double accepted
          Acceptance number, to be used when updating by MCMC
 double censorTime
          In case an event is censored save the observed time, i.e. censoring time
 boolean isCensored
          Is the event censored.
 boolean isParametric
          Is the event time parametric, i.e. unknown
 Event nextEventInSameUnit
          Link to the next event occured in same unit as this event
 Event nextIndividualEvent
          Next event for same individual, i.e. for E it is I, for I it is R.
 Unit origin
          The unit, where the infection is originating from.
 int posx
          x position in grid of the unit (quick-access)
 int posy
          y position in grid of the unit (quick-access)
 Event prevEventInSameUnit
          Link to previous event occured in same unit as this event
 double startT
          Start value if unknown and we don't want to sample blindly we can provide a start value
 double t
          Time of event
 char type
          Even type: S,E,I,R,T
 Unit unit
          Link to unit, corresponds to x,y position
 double X
          Number of susceptibles in unit posx,posy at time t
 double Y
          Number of infected in unit posx,posy at time t
 double Z
          Number of exposed in unit posy,posy at time t
 
Constructor Summary
Event()
          Empty constructor if we ever need it.
Event(Unit unit, double[] t, char type)
          Basic constructor transfering values into the object.
Event(Unit unit, double[] t, char type, boolean isCensored)
          Constructor with censoring
 
Method Summary
 java.lang.Object clone()
          Clone an event - note array instances are new'ed so the direct mem references are not exactly as before
 Event cloneExposed(double c)
          Make an exact copy of the event, but change the event to type 'E' and subtract a constant from time.
 int compare(java.lang.Object o1, java.lang.Object o2)
          Comparing based on event time.
 java.lang.String toString()
          For debug purposes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

unit

public Unit unit
Link to unit, corresponds to x,y position


posx

public int posx
x position in grid of the unit (quick-access)


posy

public int posy
y position in grid of the unit (quick-access)


t

public double t
Time of event


type

public char type
Even type: S,E,I,R,T


isParametric

public boolean isParametric
Is the event time parametric, i.e. unknown


startT

public double startT
Start value if unknown and we don't want to sample blindly we can provide a start value


accepted

public double accepted
Acceptance number, to be used when updating by MCMC


isCensored

public boolean isCensored
Is the event censored. Currently - only applies to seroconversion events.


censorTime

public double censorTime
In case an event is censored save the observed time, i.e. censoring time


X

public double X
Number of susceptibles in unit posx,posy at time t


Y

public double Y
Number of infected in unit posx,posy at time t


Z

public double Z
Number of exposed in unit posy,posy at time t


prevEventInSameUnit

public Event prevEventInSameUnit
Link to previous event occured in same unit as this event


nextEventInSameUnit

public Event nextEventInSameUnit
Link to the next event occured in same unit as this event


nextIndividualEvent

public Event nextIndividualEvent
Next event for same individual, i.e. for E it is I, for I it is R. For R it is null


origin

public Unit origin
The unit, where the infection is originating from. This is only relevant for infectious/exposed events.

Constructor Detail

Event

public Event(Unit unit,
             double[] t,
             char type)
Basic constructor transfering values into the object. To be called by more specialized versions of the constructore as well.

Parameters:
unit - Unit the event occured in
t - Time of event occurence (two dim array: place 0= startval 1=value)
type - What was the event type

Event

public Event(Unit unit,
             double[] t,
             char type,
             boolean isCensored)
Constructor with censoring

Parameters:
unit - Unit the event occured in
t - Time of event occurence (two dim array: place 0= startval 1=value)
type - What was the event type
isCensored - Censoring status, if true then t is the censoring time

Event

public Event()
Empty constructor if we ever need it. Just initialize the booleans.

Method Detail

cloneExposed

public Event cloneExposed(double c)
Make an exact copy of the event, but change the event to type 'E' and subtract a constant from time. Used to find exposures from current infections. Also the origin of the exposure is samples uniformly among the set of possibilities

Parameters:
c - The fixed length of the incubation time
Returns:
A cloned exposure event occuring at time I.t-c

clone

public java.lang.Object clone()
Clone an event - note array instances are new'ed so the direct mem references are not exactly as before


toString

public java.lang.String toString()
For debug purposes


compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Comparing based on event time. Note that if time is equal we induce an order which prefers E over R events in time.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - First object (should be of type Event)
o2 - Second object (also of type Event)
Returns:
-1,0,1 if o1 is less than, equal to, or greater than o2