traveloutcompfunc: This function gives travel out compartment in 6 categories...

Description Usage Arguments Value Examples

View source: R/traveloutcompfunc.R

Description

This function gives travel out compartment in 6 categories from 1 country to another.

Usage

1
traveloutcompfunc(total, country)

Arguments

total

total travelers out

country

a list include data of A(active confirmed), R(Recovered confirmed),D (confirmed deceased) sequences, the dynamic population pop, infect.

Value

The average realization of the country during the period

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
library(CONETTravel)
library(rlist)
data = datas_3travel[[1]][,3:5]
x = c(9999620, 250,130,0,0,0)
P= sum(x)
durationtravel = 84
w21= travelout_3dat[1,1]/(travelout_3dat[1,1] + travelout_3dat[1,3])
w31= travelout_3dat[1,1]/(travelout_3dat[1,1] + travelout_3dat[1,2])
out21 = travelout_3dat[,2]
out31 = travelout_3dat[,3]
total_in = out21*w21 + out31*w31
total_out = travelout_3dat[,1]
country = list(P=P, total_in =  total_in, total_out= total_out,durationtravel=durationtravel)
populationdynamic = populationdynamicfunc(country)
infect = c(infectfunc(data, x),0)
travelin_compartments = matrix(0,nrow=country$durationtravel,6)
S_in = round(total_in*.97,digits=0)
I_in = round(total_in*.03,digits=0)
travelin_compartments[,1] = S_in
travelin_compartments[,2] = I_in
country =list.append(country,data=data, travelin_compartments = travelin_compartments,
pop=populationdynamic,infect= infect, x_ini = x)
total = total_out
traveloutcompfunc(total, country)
## End(Not run)

leminhthien2011/CONETTravel documentation built on April 18, 2021, 4:17 a.m.