sir.sim
Class SimSIR2

java.lang.Object
  |
  +--sir.sim.SimCTMC
        |
        +--sir.sim.SimSIR2

public class SimSIR2
extends SimCTMC

Inherited class for SIR epidemic simulation, where we specialize by customizing the hook function.

Author:
Michael Höhle, 26 November 2001

Field Summary
 
Fields inherited from class sir.sim.SimCTMC
curRegime, form, m, n, noOfRegimes, noOfTrans, noOfUnits, prob
 
Constructor Summary
SimSIR2(Distributions prob, int noOfRegimes, int noOfUnits, Regime[] regimes, long[] n, long[] m)
          Constructor - setup the model parameters and initializes the necessary arrays.
 
Method Summary
static void main(java.lang.String[] argv)
          A sir sampler for command line calling.
 void RunPrintHook(double t, long[] x, long[] y, int event)
          Hook function controlling what to print when showing run trajectories.
 void transitionIntensitiesHook(double t, long[] x, long[] y)
          Transition intensities for a spatial model with 2 units
 
Methods inherited from class sir.sim.SimCTMC
sim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimSIR2

public SimSIR2(Distributions prob,
               int noOfRegimes,
               int noOfUnits,
               Regime[] regimes,
               long[] n,
               long[] m)
Constructor - setup the model parameters and initializes the necessary arrays. Just as super except M=2 fixed.

Parameters:
n - initial number of susceptible individuals
m - initial number of infectious individuals
Method Detail

transitionIntensitiesHook

public void transitionIntensitiesHook(double t,
                                      long[] x,
                                      long[] y)
Transition intensities for a spatial model with 2 units

Specified by:
transitionIntensitiesHook in class SimCTMC
Parameters:
t - time passed so far.
x - number of susceptibles.
y - number of infected.

RunPrintHook

public void RunPrintHook(double t,
                         long[] x,
                         long[] y,
                         int event)
Hook function controlling what to print when showing run trajectories.

Overrides:
RunPrintHook in class SimCTMC
Parameters:
t - time of event
x - number of susceptibles.
y - number of infected.
event - event type

main

public static void main(java.lang.String[] argv)
A sir sampler for command line calling.