|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sir.sim.SimSIR
This is the new SIR sampler capable of sampling from any SIR epidemic with grid layout. Regimes are currently not supported.
Nested Class Summary | |
class |
SimSIR.Event
|
Field Summary | |
protected java.text.NumberFormat |
form
For formatting of doubles to an output stream. |
Constructor Summary | |
SimSIR(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 |
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()
|
void |
logEvent(double t,
long[][] X,
long[][] Y,
int evx,
int evy,
int type)
Write an event to the corresponding file(s) |
static void |
main(java.lang.String[] argv)
A sir sampler for command line calling. |
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 SimSIR(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)
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 void logEvent(double t, long[][] X, long[][] Y, int evx, int evy, int type)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |