sir.util
Class Unit

java.lang.Object
  extended bysir.util.Unit

public class Unit
extends java.lang.Object

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

Version:
1.0 Class holding static information for each unit
Author:
Michael Höhle

Field Summary
 int a
          Initial number of infected
protected  Data data
          Link to data object so it knows a bit about where it is located
 Event firstEvent
          First event occuring in the unit - usually a 'N' event at time of I_0
 int N
          Initial number of susceptibles
 java.util.LinkedList N4
           
 java.util.LinkedList N4Star
          Neighbours - precomputed so we don't need to calculate it every time
 int posx
          X-position (i.e. row number) of unit in grid
 int posy
          Y-position (i.e. column number) of unit in grid
protected  Distributions prob
          Link to a random generator so we got one if we need it
 java.util.Vector rec
          Link to all recovery events occuring in this unit
 int STmembers
          Number of individuals not affected by the epidemic at time T.
 boolean vacc
          Are animals in this unit vaccinated?
 
Constructor Summary
Unit(int posx, int posy, int N, int a, boolean vacc)
          Constructor
 
Method Summary
 void fetchLocalRec(Event[] globalRec, int noOfGlobalRec)
          Fetch link to all recovery events associated to this unit and once this is found compute the number of individuals from section escaping infection.
 boolean isNeighbour(Unit u)
          Determine whether a unit is a neighbour or not.
 java.util.LinkedList N4()
          Return the compass direction neighbours
 java.util.LinkedList N4Star()
          Return set of all units belonging to N4Star
 Unit randomN4Star()
          Sample a unit from N_4^*(u) uniformly
 void setLocalLinks(Data data, Distributions prob)
           
 java.lang.String toString()
          Debug Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

N

public int N
Initial number of susceptibles


a

public int a
Initial number of infected


STmembers

public int STmembers
Number of individuals not affected by the epidemic at time T. I.e. number of unit individuals being part of S_T


posx

public int posx
X-position (i.e. row number) of unit in grid


posy

public int posy
Y-position (i.e. column number) of unit in grid


vacc

public boolean vacc
Are animals in this unit vaccinated?


rec

public java.util.Vector rec
Link to all recovery events occuring in this unit


firstEvent

public Event firstEvent
First event occuring in the unit - usually a 'N' event at time of I_0


data

protected Data data
Link to data object so it knows a bit about where it is located


prob

protected Distributions prob
Link to a random generator so we got one if we need it


N4Star

public java.util.LinkedList N4Star
Neighbours - precomputed so we don't need to calculate it every time


N4

public java.util.LinkedList N4
Constructor Detail

Unit

public Unit(int posx,
            int posy,
            int N,
            int a,
            boolean vacc)
Constructor

Parameters:
posx - x position in unit grid
posy - y position in unit grid
N - number of initial susceptible in unit
a - number of initial infectives in unit
vacc - Boolean indicating whether all animals in unit are vacicnated
Method Detail

setLocalLinks

public void setLocalLinks(Data data,
                          Distributions prob)

toString

public java.lang.String toString()
Debug Method


fetchLocalRec

public void fetchLocalRec(Event[] globalRec,
                          int noOfGlobalRec)
Fetch link to all recovery events associated to this unit and once this is found compute the number of individuals from section escaping infection. I.e. N_u - (|\r_u|-a_u)


isNeighbour

public boolean isNeighbour(Unit u)
Determine whether a unit is a neighbour or not. Currently everything is a neighbour

Returns:
boolean

N4Star

public java.util.LinkedList N4Star()
Return set of all units belonging to N4Star


N4

public java.util.LinkedList N4()
Return the compass direction neighbours

Returns:
N_4(u)

randomN4Star

public Unit randomN4Star()
Sample a unit from N_4^*(u) uniformly

Returns:
u\in N_4^*(this)