|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sir.sim.SimSelke
New sampler to handle Selke constructions. Currently, only the single homogenous setup is handled. Intention is to go to a spatial setup at some point.
Nested Class Summary | |
class |
SimSelke.Event
A class to handle events |
class |
SimSelke.Individual
Class to handle each individual in the population. |
Field Summary | |
protected java.text.NumberFormat |
form
For formatting of doubles to an output stream. |
Constructor Summary | |
SimSelke(java.lang.String baseName)
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 current X(t) and Y(t) for all units in dense form |
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. |
void |
initSampler()
|
static void |
main(java.lang.String[] argv)
A sir sampler for command line calling. |
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 |
writeLogFiles(java.lang.String baseName)
Write the corresponding events into the logfiles |
void |
writeRECHeader(java.io.PrintStream rec)
Function writes the header of the .rec file based on the current parameter values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.text.NumberFormat form
Constructor Detail |
public SimSelke(java.lang.String baseName)
baseName
- The basename giving where to store the basename.rec and basename.inf filesMethod Detail |
public void initSampler()
public void writeRECHeader(java.io.PrintStream rec)
rec
- The stream containing the recovery files.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.
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 madepublic static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |