Skip to content

Example 4.4: Model 4 SEIRS MultiSpecies Spatial Model with quarantine strategy

Bui Thi Mai Anh edited this page Jul 9, 2018 · 5 revisions

As same as the model expressed in the Example 4. But in this example, we consider the quarantine strategy to restrict the travel of infectious individuals.

The SEIRS model with quarantine strategy

The SEIRS model with quarantine is formulated as below:

Here, the quarantine concern will be specified as a dependent concern of the SEIR concern.

    QuarantineConcern := KEConcern dependOn: SEIRConcern.
	QuarantineConcern addStatus: #(Q).
	QuarantineConcern addTransitionFrom: { #status->#I } to: { #status->#Q } probability: 'delta'.
	QuarantineConcern addTransitionFrom: { #status->#Q } to: { #status->#R } probability: 'epsilon'.
	QuarantineConcern addTransitionFrom: { #status->#Q } to: #empty probability: 'mu'.
	QuarantineConcern addParameters: { #delta. #epsilon }.
	QuarantineConcern addParameter: #lambda value: 'beta*I/(N-Q)'.

When adding such concerns to the model, aside from the interactions introduced in the Example 4, it should note that the individuals belonging to the quarantine class are not allowed to move between patches.

model atParameter: #rho assignValue: [ :aModel| |c val|
		c := aModel currentCompartment at: #species.
		c = #bird ifTrue: [ val := 0.1 ].
		c = #human ifTrue: [ val := 0.03 ].
		c := aModel currentCompartment at: #status.
		(c = #Q) ifTrue: [ val := 0 ].
		val
	].

The spatial with two species model considering the quarantine strategy

We will reuse the definition of: SEIRS, spatial, multi-species concerns which are introduced in the Example 4.

Comparing to the results of the Example 4

Because of the restriction of travel of infectious individuals, the total number of infectious in each species reduces.

The script of the model:

| model SEIRConcern SEIRSConcern QuarantineConcern multiHostConcern spatialConcern simulator dB f|
	model := KEModel new.
	model population: (KEPopulation size: 27500).
	SEIRConcern := KEModelPart  new.
	SEIRConcern attributes: {#status->#(#S #E #I #R)}.
	SEIRConcern addParameters: { #beta. #gamma. #mu. #sigma}.
	SEIRConcern addParameter: #lambda value: 'beta*I/N'.
	SEIRConcern addEquations: { 
		'S:t=mu*N - lambda*S - mu*S'.
		'E:t=lambda*S - sigma*E - mu*E'.
		'I:t=sigma*E - gamma*I - mu*I'.
		'R:t=gamma*I - mu*R'
	 }.		
	
	SEIRSConcern := KEModelPart dependOn: SEIRConcern.
	SEIRSConcern addTransitionFrom: { #status->#R } to: { #status->#S } probability: 'nu'.
	SEIRSConcern addParameter: #nu.
	
	QuarantineConcern := KEModelPart dependOn: SEIRConcern.
	QuarantineConcern addStatus: #(Q).
	QuarantineConcern addTransitionFrom: { #status->#I } to: { #status->#Q } probability: 'delta'.
	QuarantineConcern addTransitionFrom: { #status->#Q } to: { #status->#R } probability: 'epsilon'.
	QuarantineConcern addTransitionFrom: { #status->#Q } to: #empty probability: 'mu'.
	QuarantineConcern addParameters: { #delta. #epsilon }.
	QuarantineConcern addParameter: #lambda value: 'beta*I/(N-Q)'.
	
	multiHostConcern := KEModelPart new.
	multiHostConcern addAttribute: #species value: #(#human #bird).
	
	spatialConcern := KEModelPart new.
	spatialConcern addAttribute: #patch value: (1 to: 5) asArray.
	spatialConcern addParameter: #rho.
   (1 to: 5) do: [ :i| 
        (i < 5) 
        ifTrue: [  
            spatialConcern 
                addTransitionFrom: { #patch->i } 
                to: { #patch->(i+1) } 
                probability: [ :aModel| aModel atParameter: #rho ].
        ]
        ifFalse: [  
            spatialConcern 
                addTransitionFrom: { #patch->i } 
                to: { #patch->1 } 
                probability: [ :aModel| aModel atParameter: #rho ].
        ]
    ]. 
	
	model integrate: SEIRConcern.
	model integrate: SEIRSConcern.
	model integrate: QuarantineConcern.
	model integrate: spatialConcern.
	model integrate: multiHostConcern.
	
	model addParameter: #beta value: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := #(0 0.21) ].
		c = #bird ifTrue: [ val := #(0 0.42) ].
		val
	].
	model atParameter: #lambda assignValue: [ :aModel| |c|
		c := aModel currentCompartment at: #patch.
		((aModel atParameter: #beta) *
		(aModel atCompartment: {#status->#I. #patch->c}) / ((aModel atParameter: #N)-(aModel atCompartment: {#status->#Q. #patch->c}))) sum.
	].
	model atParameter: #gamma assignValue: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := 0.25 ].
		c = #bird ifTrue: [ val := 0.233 ].
		val ].
	model atParameter: #sigma assignValue: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := 0.5 ].
		c = #bird ifTrue: [ val := 0.67 ].
		val ].
	model atParameter: #mu assignValue: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := 0.0000365 ].
		c = #bird ifTrue: [ val := 0.00137 ].
		val ].
	model atParameter: #N assignValue: [ :aModel| |c| 
		c := OrderedCollection new.
		c add: (aModel currentCompartment at: #patch).
		c add: (aModel currentCompartment at: #species).
		aModel sizeOfPopulation: (c asArray)
	].
	model atParameter: #nu assignValue: 0.00274.
	model atParameter: #delta assignValue: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := 0.068 ].
		c = #bird ifTrue: [ val := 0.055 ].
		val ].
	model atParameter: #epsilon assignValue: [ :aModel| |c val| 
		c := aModel currentCompartment at: #species.
		c = #human ifTrue: [ val := 0.096 ].
		c = #bird ifTrue: [ val := 0.082 ].
		val ].
	model atParameter: #rho assignValue: [ :aModel| |c val|
		c := aModel currentCompartment at: #species.
		c = #bird ifTrue: [ val := 0.1 ].
		c = #human ifTrue: [ val := 0.03 ].
		c := aModel currentCompartment at: #status.
                (c = #Q) ifTrue: [ val := 0 ].
		val
	].
	
	model 
		atCompartment: { #status->#S. #species->#bird. #patch->1 } 
		put: 4990
		atOthersPut: 0.
	model 
		atCompartment: { #status->#I. #species->#bird. #patch->1 } 
		put: 10.
	2 to: 5 do: [ :i| 
		model 
			atCompartment: { #status->#S. #species->#bird. #patch->i } 
			put: 5000.
	].
	1 to: 5 do: [ :i| 
		model 
			atCompartment: { #status->#S. #species->#human. #patch->i } 
			put: 500 
	].
	
	simulator := KESimulator new: #RungeKutta from: 0.0 to: 500 step: 1.
	simulator executeOn: model.
	dB := KEDiagramBuilder new.
	f := [:name| |d tmp|
		tmp := (simulator timeSeriesOutputsAt: name) collect: [ :e| e value ].
		d := OrderedCollection new.
		1 to: tmp first data size do: [ :k| d add: (tmp collect: [:e| e data at: k]) sum ].
		(KETimeSeries from: d withIndex: tmp first index) compartment: (STON fromString: name)
		].
	dB data: { 
		(f value: '{#status:#I,#species:#bird}'). 
		(f value: '{#status: #I, #species: #human}') }.

	dB xLabel: 'Time (days)'.
	dB legendTitle: 'Total of infectious'.
	dB legends: { 'birds'. 'humans' }.
	dB open.

The model specified with the new syntax

KendrickModel SEIRS
    attribute: #(status -> S E I R);
    parameters: #(beta lambda gamma mu sigma nu);
    lambda: #(beta*I/N);
    transitions: #(
        S -- lambda --> E.
        E -- sigma --> I.
        I -- gamma --> R.
        R -- nu --> S.
        status -- mu --> Empty.
        Empty -- mu --> S.).

KendrickModel MultiSpecies
    attribute: #(species -> human bird).

Map IndoChina
    for: #(country -> Thailand Laos Vietnam Cambodia MyanmarBurma);
    borders: #(
        #(0 1 0 1 1)
        #(1 0 1 1 1)
        #(0 1 0 1 0)
        #(1 1 1 0 0)
        #(1 1 0 0 0)).

KendrickModel Spatial
    maps: 'IndoChina';
    withTransitionRate: #(rho).

KendrickModel SEIRSQ
    extends: 'SEIRS';
    parameters: #(delta epsilon);
    addStatus: #(Q);
    addTransition: #(I -- delta --> Q.);
    addTransition: #(Q -- epsilon --> R.);
    addTransition: #(Q -- mu --> Empty.);
    lambda: #(beta*I/(N-Q)).

Composition Influenza
    model: 'SEIRSQ';
    model: 'MultiSpecies';
    model: 'Spatial'.

Scenario Scr1
    on: 'Influenza';
    populationSize: 27500;
    mu_species: #(0.000365 0.00137);
    beta_species: #(#(0 0.21) #(0 0.42));
    gamma_species: #(0.25 0.233);
    sigma_species: #(0.5 0.67);
    nu: 0.00274;
    rho_species_Q: #(0.03 0.1 0);
    lambda: #(beta*(I_patch/(N-Q_patch)) sum);
    delta_species: #(0.068 0.055);
    epsilon_species: #(0.096 0.082);
    N: #(patch_species);
    S_species_patch: #(#(500 500 500 500 500) #(4990 5000 5000 5000 5000));
    I_species_patch: #(#(0 0 0 0 0) #(10 0 0 0 0)).

Simulation InfluenzaSim rungeKutta
    scenario: 'Scr1';
    from: 0;
    to: 500;
    step: 1.

Visualization InfluenzaViz diagram
    for: 'InfluenzaSim';
    data: #(I_species);
    legendTitle: 'Infectious';
    legends: #('humans' 'birds');
    xLabel: 'Time (days)';
    exportToPng.

Custom sidebar of the Kendrick Wiki

Basic-SIR

SIR---Metapopulation

Clone this wiki locally