################################################################
#
#  EPIGRASS -Model Definition
#  This script describes model and parameters specified
#  by the user.
#  It can be edited by the user directly, by means of a text editor.
#  WARNING: No variables may be removed, even if not used by the chosen model . 
#  Any comments added by the user must be preceeded  by the symbol #
#
################################################################
################################################################

#==============================================================#
[THE WORLD]
#==============================================================#
# Here you add information about the files that describe the network

# "shapefile" is the map layer that will be used as a background for 
# the simulation display. It is defined as a list with three elements:
# the .shp filename, the variable containing the site's names,
# and the variable containing unique integers to be used as geocodes.
# ex: shapefile =  ['shape.shp','sitename','sitecode']

# "sites" and "edges" are the files that describe the topology of the
# network (see Documentation)
# The encoding variable can be set to a string stating the encoding of your 
# sites and edges files. If left empty, iso-8859-1 (latin-1) is assumed.
# See Usermanual for acceptable encoding strings.

shapefile = []
sites = sitios3.csv
edges = edgesout.csv
encoding = utf-8

#==============================================================#
[EPIDEMIOLOGICAL MODEL]
#==============================================================#
#model types available: SIS, SIS_s ,SIR, SIR_s, SEIS, SEIS_s, SEIR, SEIR_s, 
# SIpRpS, SIpRpS_s,SIpR,SIpR_s,Influenza or Custom (see documentation for description).
modtype = Influenza

#==============================================================#
[MODEL PARAMETERS]
#==============================================================#
#  They can be specified as constants or as functions of global or 
#  site-specific variables. Site-specific variables are provided
#  in the sites .csv file. In this file, all columns after the 4th
#  are collected into a values tuple, which can be referenced here 
#  as values[0], values[1], values[2], etc.
#   Examples:
#   beta = 0.001
#   beta=values[0] #assigns the first element of values to beta 
#   beta=0.001*values[1]
#   beta=0.001*N  # N is a global name for total site population

# Currently, Epigrass requires that parameters beta, alpha, e, r, delta, B, w, p
# be present in the .epg even if they will not be used. Do not erase these lines. 
# Just disregard them if they are not useful to you.

# Required parameters

beta = N*(0.08*(1-(1.-1./N)**7)+0.0001*(1-(1-1./N)**(0.5*N/values[1])))
alpha = 1     # clumping parameter
e = 0.5       # inverse of incubation period
r = 0.25      # inverse of infectious period (4 dias)
delta = 1     # probability of acquiring full immunity [0,1]
B = 0         # Birth rate
w = 0         # probability of immunity waning [0,1]
p = 0         # Probability of a recovered become infected per time step[0,1]

# Flu specific parameters
c = 0.5
g = 1/3.
d = 1/7.
pc1 = 0.67
pc2 = 0.67
pc3 = 0.67
pc4 = 0.67
pp1 = 0.32
pp2 = 0.112
pp3 = 0.13
pp4 = 0.38

#==============================================================#
[INITIAL CONDITIONS]
#==============================================================#
#   Here, the number of individuals in each epidemiological
#   state (SEI), at time 0, is specified. They can be specified in absolute
#   or relative numbers.
#   N is the population size of each site.
#   The rule defined here will be applied equally to all sites.
#   For site-specific definitions, use EVENTS (below)

#   Examples:
#   S,E,I = 0.8*N, 10, 0.5*E
#   S,E,I = 0.5*N, 0.01*N, 0.05*N
#   S,E,I = N-1, 1, 0
# Note. Epigrass expects to find S,E,I here. If not, an error will occur
# Variable names below must match names defined in model if using custom model

S=0
E=0
I=0
Susc_age1 = 0.05*N
Susc_age2 = 0.26*N
Susc_age3 = 0.61*N
Susc_age4 = 0.08*N
Incub_age1 = 0
Incub_age2 = 0
Incub_age3 = 0
Incub_age4 = 0
Subc_age1 = 0
Subc_age2 = 0
Subc_age3 = 0
Subc_age4 = 0
Sympt_age1 = 0
Sympt_age2 = 0
Sympt_age3 = 0
Sympt_age4 = 0
Comp_age1 = 0
Comp_age2 = 0
Comp_age3 = 0
Comp_age4 = 0

#=============================================================#
[EPIDEMIC EVENTS]
#=============================================================#
#  Specify isolated events.
#  Localities where the events are to take place should be identified by the geocode (sites'3th column).
#  All coverages must be a number between 0 and 1.
#  Seed:   n infected cases will be added to sites 1 and 2 at time 0.
#  Seed : [('site1's geocode','variable', n),('site2's geocode','variable', n)]. 
#  
#  Vaccinate: vaccination campaign will vaccinate a proportion cov of the susceptible population at time t
#  Vaccinate: [('locality's geocode', t, cov)]
#  Multiple vaccination campaigns with specific coverages can be specified as lists (see manual) 
#  Vaccinate: [('locality1's geocode', [t1,t2], [cov1,cov2]),('locality2's geocode', [t1,t2], [cov1,cov2])] 
#
#  Keyword 'all' may be used if all sites are vaccinated:

seed = [(355030800,'Sympt_age1',1)] #Sao Paulo
Vaccinate = [('all',[20,30],[0.5,0.5])] #Sao Paulo
Quarantine = []

# The following events have not yet been implemented
# Quarantine
# Screening = (locality, time, coverage) #screening for sick people on aiports bus stations
# Vector_control = (locality, time, coverage)
# Prophylaxis = (locality, time, target, coverage, eficacy)
# Intervention acts reducing progression between epidemiological states
# target is the name of the modified parameter
# One may specify as many treatments as necessary
# Intervention = (locality, time, target, coverage, eficacy)
# Intervention = [('all', 0, 'pp1', 0.3, 0.5),('all', 0, 'pp2', 0.3, 0.5)]



#==============================================================#
[TRANSPORTATION MODEL]
#==============================================================#
# If doTransp = 1 the transportation dynamics will be simulated; doTransp=0, otherwise
doTransp = 1

# Transportation Simulation can be stochatic (1) or deterministic(0). 
stochastic = 0

#Average speed of transportation system in km per time step. Enter 0 for instantaneous travel.
#Distance unit must be the same specified in edges files
speed =0 #1440  km/day -- equivalent to 60 km/h

#==============================================================#
[SIMULATION AND OUTPUT]
#==============================================================#

# Number of steps
steps = 10

# Output dir. Must be a full path. If empty the output will be generated on the 
# outdata-<date> sub-directory of same path as the model script.
outdir = 

# Database Output
# MySQLout can be 0 (no database output) or 1
sqlout = 1


# Replicate runs
# If replicas is set to an integer(n) larger than zero, the model will be run
# n times and the results will be consolidated before storing.
# RandSeed = 1: the seed will be randomized on each replicate
# RandSeed = 2: seeds are taken sequentially from the site's file
# Note: Replicate mode automatically turn off report and batch options. 
Replicas = 0
RandSeed = 0

# Batch Run
# list other scripts to be run in after this one. don't forget the extension .epg
# model scripts must be in the same directory as this file or provide full path.
# Example: Batch = ['model2.epg','model3.epg','/home/jose/model4.epg']
Batch = []

################################################################
################################################################


