sir.util
Class Data

java.lang.Object
  extended bysir.util.Data

public class Data
extends java.lang.Object

Title: LadyBug 2.0 Description: This is Object handles the data reading (i.e. the .data) files. It contains all the data which are then moved to an instance of the EpiState class. Copyright: Copyright (c) 2003 Company:

Version:
2.0
Author:
Michael Höhle

Field Summary
 Event[] D
          Diagnostic Events
 Event[] E
          Exposure times
 Event E1
          Exposure of first exposed
 Unit firstInfectedUnit
          Pointer to the unit, where the first infection occurs (i.e. a=1)
 Event[] I
          Infectious times
 double incu
          Length of incubatoin period
 int inoculatedIndex
          Index of the inoculated individuals
 double[] lambda
           
 int noOfBeta
           
 int noOfBetaN
           
 int noOfIndividuals
          Number of affected individuals, i.e. number of individuals mentioned in the data file
 int noOfUnits
          Various sorts of counters
 int noOfUnitsX
          Various sorts of counters
 int noOfUnitsY
          Various sorts of counters
 double[] nu
           
 Unit nullUnit
          NullUnit, special void unit to use in case of switch and terminating events
 Event[] R
          Recovery times
 double[] startVal
           
 Event T
          End of observation
 double Ttime
          Time, where experiment has ceased.
 Unit[][] units
           
 
Constructor Summary
Data()
           
 
Method Summary
 void extractLocalTau()
          Extract local recovery times for each unit and deduce the number of individuals escaping infection in all units.
 int getNoOfCensoredD()
          Get the number of unknown diagnosed times by counting number of NA's in the data
 int getNoOfUnknownD()
          Get the number of unknown diagnosed times by counting number of NA's in the data
 int getNoOfUnknownE()
          Get the number of unknown exposure times by counting number of NA's in the data
 int getNoOfUnknownI()
          Get the number of unknown infection times by counting number of NA's in the data
 int getNoOfUnknownR()
          Get the number of unknown recovery times by counting number of NA's in the data
 int[] getUnknownDIndexes()
          Find index of all unknown diagnoed time
 int[] getUnknownEIndexes()
          Find index of all unknown exposure time
 int[] getUnknownIIndexes()
          Find index of all unknown infection time
 int[] getUnknownRIndexes()
          Find index of all unknown recovery times
 int index2GridX(int index)
          Function to convert index to a X position in the grid .
 int index2GridY(int index)
          Function to convert a index to a Y grid position Labelling is (1,1)=1, (2,1)=2
 boolean isOk()
          Function to check that the data found in the data file is ok.
 double lastRecDiagTime()
          Look in the data and find the last specified rec or diag time
 void postProcess()
          Postprocess data, i.e. make data parametric if requested, setup units, check consistency, etc.
 boolean setupUnitArrays(java.util.Vector unitsVector)
          Check, that all cells in the grid layout obtained from the units are specified Convert units vector to a 2D array, and setup up unit related parameters
 java.lang.String toString()
          Usual debug method to display all on screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nu

public double[] nu

lambda

public double[] lambda

startVal

public double[] startVal

E

public Event[] E
Exposure times


I

public Event[] I
Infectious times


R

public Event[] R
Recovery times


D

public Event[] D
Diagnostic Events


T

public Event T
End of observation


units

public Unit[][] units

nullUnit

public Unit nullUnit
NullUnit, special void unit to use in case of switch and terminating events


firstInfectedUnit

public Unit firstInfectedUnit
Pointer to the unit, where the first infection occurs (i.e. a=1)


inoculatedIndex

public int inoculatedIndex
Index of the inoculated individuals


noOfUnits

public int noOfUnits
Various sorts of counters


noOfUnitsX

public int noOfUnitsX
Various sorts of counters


noOfUnitsY

public int noOfUnitsY
Various sorts of counters


noOfIndividuals

public int noOfIndividuals
Number of affected individuals, i.e. number of individuals mentioned in the data file


noOfBetaN

public int noOfBetaN

noOfBeta

public int noOfBeta

incu

public double incu
Length of incubatoin period


Ttime

public double Ttime
Time, where experiment has ceased.


E1

public Event E1
Exposure of first exposed

Constructor Detail

Data

public Data()
Method Detail

isOk

public boolean isOk()
Function to check that the data found in the data file is ok. I.e. switch time order and recov/inf pairs have to be ok.

Returns:
A boolean indicitating whether data is good.

setupUnitArrays

public boolean setupUnitArrays(java.util.Vector unitsVector)
Check, that all cells in the grid layout obtained from the units are specified Convert units vector to a 2D array, and setup up unit related parameters

Parameters:
unitsVector - All units just stuffed into a Vector

extractLocalTau

public void extractLocalTau()
Extract local recovery times for each unit and deduce the number of individuals escaping infection in all units.


getUnknownEIndexes

public int[] getUnknownEIndexes()
Find index of all unknown exposure time

Returns:
A new'ed array with the index of all unknown exposure times @see getNoOfUnknownE

getUnknownDIndexes

public int[] getUnknownDIndexes()
Find index of all unknown diagnoed time

Returns:
A new'ed array with the index of all unknown exposure times @see getNoOfUnknownS

getUnknownIIndexes

public int[] getUnknownIIndexes()
Find index of all unknown infection time

Returns:
A new'ed array with the index of all unknown infection times @see getNoOfUnknownI

getUnknownRIndexes

public int[] getUnknownRIndexes()
Find index of all unknown recovery times

Returns:
A new'ed array with the index of all unknown recovery times @see getNoOfUnknownR

getNoOfUnknownE

public int getNoOfUnknownE()
Get the number of unknown exposure times by counting number of NA's in the data

Returns:
Number of unknown exposure times.

getNoOfUnknownI

public int getNoOfUnknownI()
Get the number of unknown infection times by counting number of NA's in the data

Returns:
Number of unknown infection times.

getNoOfUnknownR

public int getNoOfUnknownR()
Get the number of unknown recovery times by counting number of NA's in the data

Returns:
Number of unknown recovery times.

getNoOfCensoredD

public int getNoOfCensoredD()
Get the number of unknown diagnosed times by counting number of NA's in the data

Returns:
Number of censored diagnosed times.

getNoOfUnknownD

public int getNoOfUnknownD()
Get the number of unknown diagnosed times by counting number of NA's in the data

Returns:
Number of unknown diagnosed times.

lastRecDiagTime

public double lastRecDiagTime()
Look in the data and find the last specified rec or diag time

Returns:
Last specified rec or diag event time specified in the data file

postProcess

public void postProcess()
Postprocess data, i.e. make data parametric if requested, setup units, check consistency, etc. This function handles all the neceassary logic to ensure the data file specified valid information.


toString

public java.lang.String toString()
Usual debug method to display all on screen


index2GridX

public int index2GridX(int index)
Function to convert index to a X position in the grid . Labelling is (1,1)=1, (2,1)=2

Parameters:
index - The index in the grid
Returns:
X position

index2GridY

public int index2GridY(int index)
Function to convert a index to a Y grid position Labelling is (1,1)=1, (2,1)=2

Parameters:
index - The index in the rid
Returns:
The y position