|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsir.sim.SimSellke
New sampler to handle Sellke constructions. Currently, only the single homogenous setup is handled. Intention is to go to a spatial setup at some point. Added seroconversion. Added so vaccine effects etc. can calculate predictive posterior distributions.
Nested Class Summary | |
class |
SimSellke.Event
A class to handle events |
class |
SimSellke.Individual
Class to handle each individual in the population. |
Field Summary | |
static int |
beta_
|
static int |
betaN_
|
static Data |
data
Data object storing the information read form the .data file |
static int |
deltaD_
|
static int |
deltaE_
|
static int |
deltaI_
|
protected static java.text.NumberFormat |
form
For formatting of doubles to an output stream. |
static int |
gammaD_
|
static int |
gammaE_
|
static int |
gammaI_
|
Constructor Summary | |
SimSellke(Distributions prob,
java.lang.String baseName,
java.io.PrintStream out,
java.lang.String origoEvent,
boolean writeResult,
boolean header,
double vac,
boolean vaccBetween)
Constructor - setup the model parameters and initializes the necessary arrays. |
Method Summary | |
boolean |
areNeighbours(int x1,
int y1,
int x2,
int y2)
Determine whether two units are neighbours or not in N_4 |
java.lang.String |
finalSize(long[][] N,
java.util.TreeSet[][] S)
Show N* for each unit, i.e. number of initial susceptibles affected by the epidemic. |
int |
gridXY2Index(int x,
int y)
Function to convert (x,y) coordinate to an index Labelling is (1,1)=1, (2,1)=2 |
int |
index2GridX(int index)
Function to convert index to a position in the grid. |
int |
index2GridY(int index)
Function to convert index to a position in the grid. |
static void |
main(java.lang.String[] argv)
A sir sampler for command line calling. |
static Distributions |
newSampler()
Method to initialize the sampler. |
long |
noOfAffected(long[][] N,
java.util.TreeSet[][] S)
Calculate, Z(t), the number of initial susceptibles affected by the epidemic (calced from current state). |
static Data |
readDataFile(java.lang.String fileName)
Read the specification from the data file. |
void |
state(java.util.TreeSet[][] S,
java.util.TreeSet[][] E,
java.util.TreeSet[][] I,
java.util.TreeSet[][] R)
Show current X(t) and Y(t) for all units |
void |
writeDataHeader(java.io.PrintStream data)
Function writes the header of the .data file based on the current parameter values. |
void |
writeLogFiles(java.lang.String baseName)
Write the corresponding events into the logfiles |
void |
writeResultHeader()
Stupid function to write header of final size results |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int beta_
public static int betaN_
public static int gammaE_
public static int deltaE_
public static int gammaI_
public static int deltaI_
public static int gammaD_
public static int deltaD_
public static Data data
protected static java.text.NumberFormat form
Constructor Detail |
public SimSellke(Distributions prob, java.lang.String baseName, java.io.PrintStream out, java.lang.String origoEvent, boolean writeResult, boolean header, double vac, boolean vaccBetween)
prob
- A distributions object for sampling etc.baseName
- The basename giving where to store the basename.rec and basename.inf fileswriteResult
- Should we write all results to log files?header
- A header to std out in case of final sizes?vac
- Vaccine effect.vaccBetween
- Vaccine effect only on the between spread, i.e. on kappa.Method Detail |
public void writeResultHeader()
public void writeDataHeader(java.io.PrintStream data)
data
- The stream containing the data file.public int index2GridX(int index)
index
- The index in the rid
public int index2GridY(int index)
index
- The index in the rid
public int gridXY2Index(int x, int y)
x
- The x coordinatey
- The y coordinate
public boolean areNeighbours(int x1, int y1, int x2, int y2)
x1
- x coordinate of first unity1
- y coordinate of first unitx2
- x coordinate of second unity2
- y coordinate of second unit
public java.lang.String finalSize(long[][] N, java.util.TreeSet[][] S)
N
- Number of initial SusceptiblesS
- Number of susceptibles at end (or at least currently).
public long noOfAffected(long[][] N, java.util.TreeSet[][] S)
N
- Number of initial SusceptiblesS
- Number of susceptibles at end (or at least currently).
public void state(java.util.TreeSet[][] S, java.util.TreeSet[][] E, java.util.TreeSet[][] I, java.util.TreeSet[][] R)
public void writeLogFiles(java.lang.String baseName)
baseName
- baseName.rec and baseName.inf are made
Deprecated version with rec and inf file. Now just one .data filepublic static Data readDataFile(java.lang.String fileName)
fileName
- Name of the .data file...public static Distributions newSampler()
public static void main(java.lang.String[] argv)
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |