ppa.yaml 41.2 KB
Newer Older
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
---
#  __  __           _      _
# |  \/  |         | |    | |
# | \  / | ___   __| | ___| |
# | |\/| |/ _ \ / _` |/ _ \ |
# | |  | | (_) | (_| |  __/ |
# |_|  |_|\___/ \__,_|\___|_|
#
#  _____        __                           _   _
# |_   _|      / _|                         | | (_)
#   | |  _ __ | |_ ___  _ __ _ __ ___   __ _| |_ _  ___  _ __
#   | | | '_ \|  _/ _ \| '__| '_ ` _ \ / _` | __| |/ _ \| '_ \
#  _| |_| | | | || (_) | |  | | | | | | (_| | |_| | (_) | | | |
# |_____|_| |_|_| \___/|_|  |_| |_| |_|\__,_|\__|_|\___/|_| |_|


# NAME OF THE MODEL
model_name: compart_SEIC


# DESCRIPTION OF THE MODEL
model_info:
  abstract: 'This model is a simple discrete-time, stochastic, compartment-based model for African Swine Fever, mixing wild boars and domestic pigs.'
  author:
    - 'Pauline Ezanno (pauline.ezanno@inra.fr)'
    - 'Sebastien Picault (sebastien.picault@inra.fr)'
  TODO:
    - 'log hunted WB'
    - 'perform tests on hunted WB'

#  _______ _
# |__   __(_)
#    | |   _ _ __ ___   ___
#    | |  | | '_ ` _ \ / _ \
#    | |  | | | | | | |  __/
#    |_|  |_|_| |_| |_|\___|

time_info:
  time_unit: 'days'
  delta_t: 1
  origin: 'October 1, 2019'
  total_duration: '500'         # to halt just after end of hunting period


#  _                    _
# | |                  | |
# | |     _____   _____| |___
# | |    / _ \ \ / / _ \ / __|
# | |___|  __/\ V /  __/ \__ \
# |______\___| \_/ \___|_|___/

levels:
  epid_unit:
    desc: 'level of the epidemiological unit, either a pig herd or a wild boar'
    aggregation_type: 'compartment'
    default_prototype: default_epid_unit
    class_name: EpidUnit
    file: 'ppa.py'
  metapop:
    desc: 'level of the metapop'
    default_prototype: default_metapop
    aggregation_type: 'metapopulation'
    class_name: Metapop
    file: 'ppa.py'
    contains:
      - epid_unit

#  _____
# |  __ \
# | |__) | __ ___   ___ ___  ___ ___  ___  ___
# |  ___/ '__/ _ \ / __/ _ \/ __/ __|/ _ \/ __|
# | |   | | | (_) | (_|  __/\__ \__ \  __/\__ \
# |_|   |_|  \___/ \___\___||___/___/\___||___/

processes:
  metapop:
    - change_seed
    - distant_wildboar_mortality
    - active_carcass_search
    - reactivate_units
    - preventive_culling
    - pig_trade
    - install_fences
    - compute_contributions_from_kernels
    - check_if_finished
  epid_unit:
    - integrate_purchased_pigs
    - infection
    - unit_removal
    - perform_sales
    - update_health_info
    - log_custom_vars


#   _____                       _
#  / ____|                     (_)
# | |  __ _ __ ___  _   _ _ __  _ _ __   __ _
# | | |_ | '__/ _ \| | | | '_ \| | '_ \ / _` |
# | |__| | | | (_) | |_| | |_) | | | | | (_| |
#  \_____|_|  \___/ \__,_| .__/|_|_| |_|\__, |
#                        | |             __/ |
#                        |_|            |___/


grouping:
  epid_unit:
    infection:
      machine_name: health_state
      key_variables: [health_state]


#   _____ _        _         __  __            _     _
#  / ____| |      | |       |  \/  |          | |   (_)
# | (___ | |_ __ _| |_ ___  | \  / | __ _  ___| |__  _ _ __   ___  ___
#  \___ \| __/ _` | __/ _ \ | |\/| |/ _` |/ __| '_ \| | '_ \ / _ \/ __|
#  ____) | || (_| | ||  __/ | |  | | (_| | (__| | | | | | | |  __/\__ \
# |_____/ \__\__,_|\__\___| |_|  |_|\__,_|\___|_| |_|_|_| |_|\___||___/

state_machines:
  Zone:
    desc: 'type of habitat where a given epidemiological unit lives'
    states:
      - For:
          name: 'Forest'
          desc: 'Forest area'
      - Agr:
          name: 'Agricultural'
          desc: 'Agricultural area'
      - Urb:
          name: 'Urban'
          desc: 'Urban area'
  production:
    desc: 'productions of the different kinds of pig herds'
    states:
      - B:
          name: 'Breeder'
          desc: 'Breeder'
      - BF:
          name: 'Breeder-Fattener'
          desc: 'Breeder-Fattener'
      - F:
          name: 'Fattener'
          desc: 'Fattener'

  health_state:
    desc: 'The state machine which defines the evolution of health states'
    states:
      - S:
          name: 'Susceptible'
          desc: 'suceptible of becoming infected'
          fillcolor: 'deepskyblue'
      - E:
          name: 'Exposed'
          desc: 'infected and not yet able to transmit the pathogen'
          fillcolor: 'orange'
          on_enter:
            - set_var: changed
              value: yes
            - set_var: is_infected
              value: 1
      - I:
          name: 'Infectious'
          desc: 'infected and able to transmit the disease'
          fillcolor: 'maroon'
          on_enter:
            - set_var: changed
              value: yes
          on_stay:
            - set_var: is_detected
              value: 'MAX(is_detected, random_bool(proba_detection_alive_epidunit))'
              # site detected if at least one I animal detected
            - action: notify_detection
      - C:
          name: 'Carcass'
          desc: 'dead infected animal not yet removed from environment'
          fillcolor: 'darkolivegreen'
          on_enter:
            - set_var: changed
              value: yes
            - set_var: is_detected
              value: 'MAX(is_detected, random_bool(is_pig_herd * proba_detection_carcass_epidunit))'
              # pig herd detected if at least one of the new C is detected
            - action: notify_detection
            - action: remove_carcass
          on_stay:
            - set_var: is_detected
              value: 'MAX(is_detected, random_bool((1 - is_pig_herd) * proba_detection_carcass_epidunit))'
              # wildboar carcass detected while in environment
            - action: notify_detection
            - action: remove_carcass
      - D:
          name: 'Dead'
          desc: 'dead animal not infectious and not yet removed from environment'
          fillcolor: 'gray'
          on_enter:
            - set_var: changed
              value: yes
      - Exit:
          on_enter:
            - set_var: changed
              value: yes
          name: 'Exit'
          desc: 'removed dead animals'
          fillcolor: 'white'
          autoremove: yes

    transitions:
      - {from: S, to: E, rate: 'force_of_infection', desc: 'see Python add-on for other pathways'}
      - {from: E, to: I, rate: '1/incubation'}
      - {from: I, to: C, rate: 'is_pig_herd * asf_death_rate'}
      - from: I
        to: C
        rate: ' (1 - is_pig_herd) * (asf_death_rate + wildboar_death_rate)'
      - from: S
        to: D
        rate: ' (1 - is_pig_herd) * wildboar_death_rate'
      - from: E
        to: C
        rate: ' (1 - is_pig_herd) * wildboar_death_rate'
        desc: 'assuming that 1) disease does not cause death during incubation, but also that 2) though E are less infectious than I, E carcasses are considered infectious'
      - {from: C, to: Exit, rate: 'C_removal_rate'}
      - {from: D, to: Exit, rate: 'C_removal_rate'}
      - from: S
        to: Exit
        rate: 'hunting_rate * (1 - is_pig_herd)'
        on_cross:
          # - action: die_by_hunting
          - set_var: is_hunted
            value: 1
          - set_var: is_tested
            value: 'random_bool(proba_detection_hunted_wildboars)'
          # - action: print_hunting_status
          - set_var: changed
            value: yes
          - action: log_custom_vars
      - from: E
        to: Exit
        rate: 'hunting_rate * (1 - is_pig_herd)'
        on_cross:
          - set_var: is_hunted
            value: 1
          - set_var: is_tested
            value: 'random_bool(proba_detection_hunted_wildboars)'
          # - action: print_hunting_status
          - set_var: changed
            value: yes
          - action: notify_detection
          - action: log_custom_vars
      - from: I
        to: Exit
        rate: 'hunting_rate * (1 - is_pig_herd)'
        on_cross:
          - set_var: is_hunted
            value: 1
          - set_var: is_tested
            value: 'random_bool(proba_detection_hunted_wildboars)'
          # - action: print_hunting_status
          - set_var: changed
            value: yes
          - action: notify_detection
          - action: log_custom_vars
        # NOTA: hunting is also taken into account for non-active wildboars (see Python)


#               _   _
#     /\       | | (_)
#    /  \   ___| |_ _  ___  _ __  ___
#   / /\ \ / __| __| |/ _ \| '_ \/ __|
#  / ____ \ (__| |_| | (_) | | | \__ \
# /_/    \_\___|\__|_|\___/|_| |_|___/
actions:
  notify_detection:
    desc: 'inform the metapopulation that an epid unit has just detected a case'
  log_custom_vars:
    desc: 'log the state of current epidemiological unit if changed'
#  _____                               _
# |  __ \                             | |
# | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___
# |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
# | |  | (_| | | | (_| | | | | | |  __/ ||  __/ |  \__ \
# |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/


parameters:
  # INITIAL CONDITIONS
  # number of herds, number of wild boars read in input
  # data
  # virus_intro_type:
  #   desc: 'how the virus is introduced in the agroecosystem'
  #   value: 'TODO'
  # - external risk (sandwich)
  # - purchase of infected pig (E/I)
  # - immigration of infected boar (E/I)
  # - circulation of contaminated humans from outside
  nb_pig_herds:
    desc: 'maximum number of pig herds in the metapop'
    value: 4775
    source: 'file herds.csv'
  nb_wild_boars:
    desc: 'maximum number of total wild boar units in the metapop'
    value: 500366
    source: 'file boars.csv'
  nb_infected_pig_herds:
    desc: 'number of initially infected pig herds'
    value: 0
  nb_infected_wild_boars:
    desc: 'number of initiazlly infectedf wild boars'
    value: 1
  wildboar_unit_size:
    desc: 'number of wildboars per unit'
    value: 1
  infected_boar_ID:
    desc: 'ID of the 1st infected wildboar in the CSV file'
    value: 413678
    source: 'chosen Jan 10'
  infected_pig_herd_ID:
    desc: 'ID of the 1st infected pig herd in the CSV file'
    value: 4206
  # LIFE CYCLE PARAMETERS
  # herd size heterogeneous and read from input data, constant over time
  # sold pigs replaced by susceptible ones
  # purchased pigs generate as many slaughtered pigs with health
  # states sampled randomly (function of the prevalence in the herd)

  # EPIDEMIOLOGICAL PARAMETERS
  incubation:
    desc: 'incubation duration (days), only accounting for the shedding period before symptoms'
    value: 7
    source: 'changed from 2 to 7, Jan 20'
  asf_death_rate:
    desc: 'death rate induced by ASF (/day)'
    value: '1/7'
    source: 'changed from 1/5 to 1/7, Jan 20'
  wildboar_death_rate:
    desc: 'natural death rate of wildboars (/day)'
    value: '1/(365*5)'
  proportion_wildboars_hunted_default:
    desc: 'proportion of the wild boars population hunted during the whole hunting period on the whole island'
    value: 0.5
  hunting_rate_fences:
    desc: 'hunting rate (/day) within fences once the decision to reduce population is taken, until the end of hunting period'
    value: '1 - (1 - proportion_wildboars_hunted_fences)**(1 / duration_hunting_within_fences)'
  hunting_rate_buffer:
    desc: 'hunting rate (/day) around fences once the decision to reduce population is taken, until the end of the special population reduction period'
    value: '1 - (1 - proportion_wildboars_hunted_buffer)**(1 / duration_hunting_within_buffer)'
  hunting_rate_default:
    desc: 'hunting rate (/day) assuming a fixed proportion of the population during hunting period, constant in time and space'
    value: 'is_hunting_period * (1 - (1 - proportion_wildboars_hunted_default)**(1 / hunting_duration))'
  is_hunting_period:
    desc: 'boolean, 1 if current time is during hunting period, 0 otherwise'
    value: '(time >= hunting_start_date) * (time <= hunting_start_date + hunting_duration)'
  hunting_rate:
    desc: 'hunting rate, depending on areas: when fences are installed around targeted tiles, hunting rate within and around fences can be increased (independently from hunting period)'
    value: 'IfThenElse(ongoing_hunting_within_fences * is_within_fences, hunting_rate_fences, IfThenElse(ongoing_hunting_within_buffer * is_within_buffer, hunting_rate_buffer, hunting_rate_default))'
  herd_C_removal_rate:
    desc: 'rate at which carcasses are removed from pig herds (/day) - value meaningless, chosen so that the probability of removal is close to 1'
    value: 100
  wildboar_C_removal_rate:
    desc: 'rate at which carcasses of wild boars disappear in nature (/day)'
    value: '1/90'
  coeff_tr_intra:
    desc: 'Attenuation of the within-herd force of infection'
    value: 1
  transmission_intra:
    desc: 'transmission rate from infectious animals within the epidemiological unit (/day)'
    value: ' coeff_tr_intra * ((1 - is_commercial) * transmission_intra_backyard + is_commercial * transmission_intra_commercial)'
    source: 'Halasa 2016 based on experimental infections Guinat 2015, assuming a faster spread in unstructured herds'
  transmission_intra_commercial:
    desc: 'transmission rate from infectious animals within a commercial pig farm (/day)'
    value: 0.4
    source: 'Halasa 2016 based on experimental infections Guinat 2015, assuming a faster spread in unstructured herds'
  transmission_intra_backyard:
    desc: 'transmission rate from infectious animals within a backyard pig farm (/day)'
    value: 0.6
    source: 'Halasa 2016 based on experimental infections Guinat 2015, assuming a faster spread in unstructured herds'
  transmission_boar_pig:
    desc: 'transmission rate between boars and pigs (/day)'
    value: 0.008
    source: 'assuming that the transmission rate is the same between species if contact occurs, contact being represented by the kernel'
  transmission_boar_boar:
    desc: 'transmission rate between boars (/day)'
    value: 'transmission_boar_pig'
    source: 'assuming that the transmission rate is the same than between pigs if contact occurs, contact being represented by the kernel'
  transmission_other_pathways:
    desc: 'transmission rate from farm to farm due to indirect transmission (/day)'
    value: 'transmission_boar_pig'
    # * IfThenElse(OR(is_detected, is_contact), external_risk_reduction, 1)' now in Python
    source: 'assuming that the transmission rate is the same than between pigs if contact occurs, contact being represented by the kernel'
  external_risk_reduction:
    desc: 'multiplicative factor for reducing indirect transmission between pig farms and between pigs and boars, due to improved biosecurity (desinfection of persons, materials, vehicles, barriers): 0: no external risk, 1: default'
    value: 0.5
  alpha_boar_static:
    desc: 'dispersal scale (m) in the kernel function for boars reaching a static target (pig herds or carcasses), involved in boar-to-pig and pig-to-boar transmission for outdoor pig herds and in carcass-to-boar transmission'
    value: 1000
  alpha_boar_boar:
    desc: 'dispersal scale (m) in the kernel function for boar-to-boar transmission, accounting for the fact that both boars move (twice the value of the alpha_boar_static value)'
    value: 2000
  alpha_other_pathways:
    desc: 'diffusion coefficient in the kernel function for transmission to pigs occurring from other pathways (human visits, material, etc.)'
    value: 1000
    source: 'Halasa 2016 assuming no more than 2 km and distance-based'
  contrib_E_transmission:
    desc: 'ratio of E shedding rate over I shedding rate, assumed to be half'
    value: 0.5
  FOI_intra_unit:
    desc: 'force of infection due to transmission within the epidemiological unit (no effect in single individuals) - for now transmission rate is the same for I and C'
    value: 'transmission_intra * (contrib_E_transmission * total_E + total_I + total_C) / (total_epid_unit - total_C - total_D + epsilon)'
    source: 'classical function assuming frequency dependence'

  ## ALL OTHER FOI ARE NOW HANDLED BY THE METAPOP (IN PYTHON)
  ## which now determines which epid units will be infected by existing infected epid units
  force_of_infection:
    desc: 'force of infection experienced by susceptible wild boars or by suceptible pigs in a pig herd'
    value: 'FOI_intra_unit'

  epsilon:
    desc: 'constant to avoid divisions by zero'
    value: '1e-9'

  # DETECTION PARAMETERS
  is_contact:
    desc: '1 if the pig herd has exchanged animals with a detected pig herd within a delay (pig_contact_window) or is in a surveillance/protection area, 0 otherwise'
    value: 'OR(is_traced, is_in_protection_area, is_in_surveillance_area)'
  pig_contact_window:
    desc: 'duration before suspicion during which trade (in and out) contacts are at risk (days)'
    value: '3*7'
  pig_herd_surveillance:
    desc: 'boolean, True if a passive surveillance over pig herds is set up'
    value: 1
  wildboar_surveillance:
    desc: 'boolean, True if a passive surveillance over wildboars is set up'
    value: 1
  hunting_surveillance:
    desc: 'boolean value, 0 if no test on hunted wildboars, 1 otherwise'
    value: 1
  proba_detection_hunted_wildboars:
    desc: 'proportion of hunted wildboars tested once first case detected and CONFIRMED'
    # value: 'hunting_surveillance * is_first_outbreak * (time > date_first_detection + delay_confirmation) * IfThenElse(ongoing_hunting_within_fences * is_within_fences + ongoing_hunting_within_buffer * is_within_buffer > 0, proba_detection_hunted_wildboars_increased, proba_detection_hunted_wildboars_default)'
    value: 'hunting_surveillance * is_first_outbreak * (time > date_first_detection + delay_confirmation) * IfThenElse(OR(ongoing_hunting_within_fences * is_within_fences,  ongoing_hunting_within_buffer * is_within_buffer), proba_detection_hunted_wildboars_increased, proba_detection_hunted_wildboars_default)'
  proba_detection_hunted_wildboars_default:
    desc: 'default proportion of hunted wildboars tested once first case detected'
    value: 0.2
  proba_detection_hunted_wildboars_increased:
    desc: 'default proportion of wildboars tested once first case detected, when hunted in areas with increased hunting'
    value: 1.0
  proba_detection_alive_epidunit:
    desc: 'probability to detect ASF based on living animals in an epidemiological unit (depends on the number of infected animals)'
    value: '1 - (1 - proba_detection_alive)**total_I'
  proba_detection_carcass_epidunit:
    desc: 'probability to detect ASF based on carcasses in an epidemiological unit (depends on the number of dead animals)'
    value: '1 - (1 - proba_detection_carcass)**total_C'
  proba_detection_alive:
    desc: 'probability to detect one infectious animal'
    value: 'pig_herd_surveillance * is_pig_herd * ((1 - is_first_outbreak) * proba_pig_detection_alive_primary
              + is_first_outbreak * (1 - is_contact) * proba_pig_detection_alive_secondary
              + is_first_outbreak * is_contact * proba_pig_detection_alive_restricted_area) +
            wildboar_surveillance * (1 - is_pig_herd) * ((1 - is_first_outbreak) * proba_boar_detection_alive_primary
               + is_first_outbreak * proba_boar_detection_alive_secondary)'
  proba_detection_carcass:
    desc: 'probability to detect one infected carcass'
    value: 'pig_herd_surveillance * is_pig_herd * ((1 - is_first_outbreak) * proba_pig_detection_carcass_primary
              + is_first_outbreak * (1 - is_contact) * proba_pig_detection_carcass_secondary
              + is_first_outbreak * is_contact * proba_pig_detection_carcass_restricted_area) +
            wildboar_surveillance * (1 - is_pig_herd) * ((1 - is_first_outbreak) * proba_boar_detection_carcass_primary
               + is_first_outbreak * proba_boar_detection_carcass_secondary * local_carcass_detection_factor)'
  local_carcass_detection_factor:
    desc: 'factor that changes probability to detect carcasses, increased in tiles where increase hunting is currently implemented, 1 otherwiser'
    value: 'IfThenElse(ongoing_hunting_within_fences * is_within_fences + ongoing_hunting_within_buffer * is_within_buffer > 0, factor_carcass_detection_increased_hunting, 1)'
  proba_pig_detection_alive_primary:
    desc: 'probability to detect site with infectious pigs for the first time in the whole metapop (pigs + wildboars)'
    value: 'is_commercial * proba_pig_detection_alive_primary_commercial + (1 - is_commercial) * proba_pig_detection_alive_primary_backyard'
  proba_pig_detection_alive_primary_commercial:
    desc: 'probability to detect site with infectious pigs for the first time in the whole metapop (pigs + wildboars)'
    value: 0.01
  proba_pig_detection_alive_primary_backyard:
    desc: 'probability to detect site with infectious pigs for the first time in the whole metapop (pigs + wildboars)'
    value: 0
  proba_pig_detection_alive_secondary:
    desc: 'probability to detect site with infectious pigs when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 'is_commercial * proba_pig_detection_alive_secondary_commercial + (1 - is_commercial) * proba_pig_detection_alive_secondary_backyard'
  proba_pig_detection_alive_secondary_commercial:
    desc: 'probability to detect site with infectious pigs when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.02
  proba_pig_detection_alive_secondary_backyard:
    desc: 'probability to detect site with infectious pigs when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.005
  proba_pig_detection_alive_restricted_area:
    desc: 'probability to detect site with infectious pigs within a restricted area (protection/surveillance area or trade contact)'
    value: 'is_commercial * proba_pig_detection_alive_area_commercial + (1 - is_commercial) * proba_pig_detection_alive_area_backyard'
  proba_pig_detection_alive_area_commercial:
    desc: 'probability to detect site with infectious pigs when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.1
  proba_pig_detection_alive_area_backyard:
    desc: 'probability to detect site with infectious pigs when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.025
  proba_boar_detection_alive_primary:
    desc: 'probability to detect infected alive wildboars for the first time in the whole metapop (pigs + wildboars)'
    value: 0
  proba_boar_detection_alive_secondary:
    desc: 'probability to detect infected alive wildboars when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0
  proba_pig_detection_carcass_primary:
    desc: 'probability to detect site with infected pig carcasses for the first time in the whole metapop (pigs + wildboars)'
    value: 'is_commercial * proba_pig_detection_carcass_primary_commercial + (1 - is_commercial) * proba_pig_detection_carcass_primary_backyard'
  proba_pig_detection_carcass_primary_commercial:
    desc: 'probability to detect site with infected pig carcasses for the first time in the whole metapop (pigs + wildboars)'
    value: 0.04
  proba_pig_detection_carcass_primary_backyard:
    desc: 'probability to detect site with infected pig carcasses for the first time in the whole metapop (pigs + wildboars)'
    value: 0
  proba_pig_detection_carcass_secondary:
    desc: 'probability to detect site with infected pig carcasses when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 'is_commercial * proba_pig_detection_carcass_secondary_commercial + (1 - is_commercial) * proba_pig_detection_carcass_secondary_backyard'
  proba_pig_detection_carcass_secondary_commercial:
    desc: 'probability to detect site with infected pig carcasses when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.08
  proba_pig_detection_carcass_secondary_backyard:
    desc: 'probability to detect site with infected pig carcasses when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.02
  proba_pig_detection_carcass_restricted_area:
    desc: 'probability to detect site with infected pig carcasses in a restricted area (protection/surveillance area or trade contact)'
    value: 'is_commercial * proba_pig_detection_carcass_area_commercial + (1 - is_commercial) * proba_pig_detection_carcass_area_backyard'
  proba_pig_detection_carcass_area_commercial:
    desc: 'probability to detect site with infected pig carcasses in a restricted area (protection/surveillance area or trade contact)'
    value: 0.4
  proba_pig_detection_carcass_area_backyard:
    desc: 'probability to detect site with infected pig carcasses in a restricted area (protection/surveillance area or trade contact)'
    value: 0.1
  proba_boar_detection_carcass_primary:
    desc: 'probability to detect infected wildboar carcasses for the first time in the whole metapop (pigs + wildboars) - applied every day on existing carcasses (up to carcass removal). For 90 days of presence, proba=1e-4 => about 100 days to detect. TODO: calibrate the value to detect circulation (not necessarily the first case) in boars 3 months after 1st introduction'
    value: 0.0001
    source: 'changed from 1e-4 to 1e-5, Jan 10 ; back to 1e-4, Jan 20'
  proba_boar_detection_carcass_secondary:
    desc: 'probability to detect infected wildboar carcasses when a first case has already been detected in the whole metapop (pigs + wildboars)'
    value: 0.0001
    source: 'changed from 1e-4 to 1e-5, Jan 10 ; back to 1e-4, Jan 20'
  proba_detection_carcass_active_search:
    desc: 'probability that a wildboar carcass (infected or not) is found when an active search is performed within a given area (probability for the whole search period)'
    value: 0.1
  radius_boar_detection_carcass_active:
    desc: 'radius of the area for active carcass search (m), depending on the implementation of control measures. The radius for active carcass search can be enlarged once first case has been detected, after a delay. Since in the Python procedure, the radius is calculated at the end of active search operations, its correct value must take into account the duration of the active search, to calculate the expected value when active search decision is taken'
    value: 'IfThenElse(AND(wider_active_search, time - duration_carcass_active_search >= delay_wider_active_search + date_first_detection),
            radius_wider_active_search, default_radius_boar_detection_carcass_active)'
  default_radius_boar_detection_carcass_active:
    desc: 'default radius of the area for active carcass search (m)'
    value: 1000
  delay_carcass_active_search:
    desc: 'delay between the discovery of an infected wild boar carcass and the organization of an active wild boar carcass search in the corresponding area (days)'
    value: 5
  duration_carcass_active_search:
    desc: 'durationn of the active search campaign to find wild boar carcasses (days)'
    value: 5
  delay_to_removal:
    desc: 'number of days needed between detection and epidemiological unit removal'
    value: 'is_pig_herd * delay_confirmation + (1 - is_pig_herd) * delay_boar_removal'
  delay_confirmation:
    desc: 'number of days needed between suspicion and confirmation, pig removal being then immediate'
    value: 4
  is_first_outbreak:
    desc: ''
    value: 'date_first_detection > 0'
  delay_boar_removal:
    desc: 'boar carcasses found are immediately removed to be tested (before any test results)'
    value: 0
  repopulation_delay:
    desc: 'delay after which a pig herd which was entirely removed after confirmation can be repopulated (days)'
    value: 50
  trade_suspicion_duration:
    desc: 'duration (days) during which herds in contact with confirmed cases are considered suspicious, assumed equal to the duration of the protection area'
    value: 'protection_duration'
    source: 'checked with Timothee'
  protection_radius:
    desc: 'radius (m) of the area centered on a confirmed case, within which all pig herds are considered suspicious - protection area'
    value: 3000
  protection_duration:
    desc: 'duration (days) during which herds within the protection area are considered suspicious'
    value: 40
  surveillance_radius:
    desc: 'radius (m) of the area centered on a confirmed case, within which all pig herds are considered suspicious - sureillance area, depending on control measures'
    value: 'IfThenElse(AND(wider_surveillance_area, time >= delay_wider_surveillance_area + date_first_detection),
            radius_wider_surveillance_area, default_surveillance_radius)'
  default_surveillance_radius:
    desc: 'default radius (m) of the area centered on a confirmed case, within which all pig herds are considered suspicious - sureillance area'
    value: 10000
  surveillance_duration:
    desc: 'duration (days) during which herds within the surveillance area are considered suspicious'
    value: 30
  protection_if_detected_wildboar:
    desc: 'boolean to indicate whether or not a protection/surveillance area is setup when a dected wildboar is found'
    value: 0
  # CONTROL PARAMETERS
  game_duration:
    desc: 'duration (days) of the time series provided to players. Used to stop simulation when enough data to provide to players.'
594
    value: 300
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
  delay_implementation:
    desc: 'duration (days) between the decision to perform a preventive culling and the actual culling. The total delay between the cause of culling (e.g. setup of the protection area) and the actual culling is thus delay_confirmation + delay_implementation (used in Python)'
    value: 3
  cull_in_protection_area:
    desc: 'boolean to indicate whether or not to implement a preventive culling of pig herds in protected areas, after a delay'
    value: 0
  delay_cull_in_protection_area:
    desc: 'delay (days from first detection) after which the preventive culling of pig herds in protected areas is implemented'
    value: 90
  wider_active_search:
    desc: 'boolean to indicate whether or not the radius of active search for wildboar carcasses is enlarged, after a delay, and within a specific radius'
    value: 0
  delay_wider_active_search:
    desc: 'delay (days from first detection) after which the radius of active search for wildboar carcasses is enlarged'
    value: 90
  radius_wider_active_search:
    desc: 'enlarged radius of active search for wildboar carcasses (m)'
    value: 2000
  cull_near_infected_carcasses:
    desc: 'boolean to indicate whether or not to implement a preventive culling of pig herds within a given radius from detected infected wildboar carcasses, after a delay'
615
    value: 1
616
617
  delay_cull_near_infected_carcasses:
    desc: 'delay (days from first detection) after which the preventive culling of pig herds near infected wildboar carcasses is implemented'
618
    value: 90
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
  radius_cull_near_infected_carcasses:
    desc: 'radius (m) around infected wildboar carcasses to implement preventive culling of pig herds'
    value: 3000
  wider_surveillance_area:
    desc: 'boolean to indicate whether or not the radius of surveillance area is enlarged, after a delay, with a specific radius'
    value: 0
  delay_wider_surveillance_area:
    desc: 'delay (days from beginning of hunting period) after which the radius of surveillance area is enlarged'
    value: 120
  radius_wider_surveillance_area:
    desc: 'enlarged radius (m) for surveillance area'
    value: 15000
  cull_traced_herds:
    desc: 'boolean to indicate whether or not to implement, after a delay, a preventive culling of pig herds in trade contact with detected pig herds within pig_contact_window'
    value: 0
  delay_cull_traced_herds:
    desc: 'delay (days from beginning of hunting period) after which the preventive culling of pig herds in trade contact with detected herds is implemented'
    value: 150
  use_fences:
    desc: 'boolean to indicate whether or not to implement, after a delay, the installation of fences between all tiles of the map where at least one infected epidemiological unit has been (tiles loaded in the simulation) and the adjacent ones. The effect of fences is a reduction of the transmission kernels between living boars, and between living boars and static infectious units (boar carcasses or pig herds). The kernel representing indirect transmission between farms is not affected. The corresponding process is "one shot", in the sense that the installation of fences leads to a permanent modification of the kernel which is calculated only on the time step corresponding to the delay'
    value: 1
  fences_efficacy:
    desc: 'coefficient used to modify kernels when installing fences. Affected kernels are multiplied by (1-fences_efficacy), thus 1 is the highest efficacy (kernel becomes 0), 0 the lowest (kernel unchanged)'
    value: 0.99
  delay_use_fences:
    desc: 'delay (days from the date of first detection) after which the installation of fences is implemented'
    value: 60
  hunt_within_fences:
    desc: 'boolean parameter to determine whether or not wildboars within fences are subject to increased hunting after a delay'
    value: 1
  hunt_within_buffer:
    desc: 'boolean parameter to determine whether or not wildboars around fences are subject to increased hunting after a delay'
    value: 1
  delay_hunt_within_fences:
    desc: 'delay (days) after fences installation, after which wildboars living within fences are subject to increased hunting'
    value: 1
  delay_hunt_within_buffer:
    desc: 'delay (days) after fences installation, after which wildboars living around fences are subject to increased hunting (negative value = hunting starts before fences installation, assuming that fences position is already decided)'
    value: 1
  proportion_wildboars_hunted_fences:
    desc: 'proportion of the wild boar population hunted within fences between the decision to reduce population and the end of hunting period'
    value: 0.9
  proportion_wildboars_hunted_buffer:
    desc: 'proportion of the wild boar population hunted around fences between the decision to reduce population and the end of the special population reduction period'
    value: 0.9
  ongoing_hunting_within_fences:
    desc: 'boolean which calculates if increased hunting within fences is currently implemented'
    value: 'use_fences * hunt_within_fences * (date_first_detection > 0) * (time >= date_first_detection + delay_use_fences + delay_hunt_within_fences) * (time < date_first_detection + delay_use_fences + delay_hunt_within_fences + duration_hunting_within_fences)'
  ongoing_hunting_within_buffer:
    desc: 'boolean which calculates if increased hunting around fences is currently implemented'
    value: 'use_fences * hunt_within_buffer * (date_first_detection > 0) * (time >= date_first_detection + delay_use_fences + delay_hunt_within_buffer) * (time < date_first_detection + delay_use_fences + delay_hunt_within_buffer + duration_hunting_within_buffer)'
  forbid_active_search_buffer:
    desc: 'boolean which forbids active carcass search around fences during increased hunting'
    value: 1
  forbid_active_search_fences:
    desc: 'boolean which forbids active carcass search within fences during increased hunting'
    value: 1
  duration_hunting_within_fences:
    desc: 'duration (days) of increased hunting on the tiles surrounded by fences (date when hunting stops - date when measure starts)'
    value: '(hunting_start_date + hunting_duration) - (date_first_detection + delay_use_fences + delay_hunt_within_fences)'
  duration_hunting_within_buffer:
    desc: 'duration (days) of increased hunting on the tiles surrounding fences (assumed constant)'
    value: '61'
  factor_carcass_detection_increased_hunting:
    desc: 'factor which multiplies the probability to detect wildboar carcasses within/around fences when increased hunting is implemented'
    value: 5

  # SEED CHANGEMENT:
  use_second_seed:
    desc: 'boolean to indicate whether or not to implement, after a delay, a changement of seed to create new trajectories'
    value: 0
  delay_change_seed:
    desc: 'delay (days) after detection, after which we change the seed'
692
    value: 110
693
694
695
696
697
698
699
700
701
  second_seed:
    desc: 'value of the new seed'
    value: 0


  # SPATIAL PARAMETERS
  resolution:
    desc: 'size of a tile (m)'
    value: 15000
Sebastien Picault's avatar
Sebastien Picault committed
702
703
704
  buffer_area_size:
    desc: 'width of the buffer surrounding fences'
    value: 15000
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869

  # HUNTING DATES
  hunting_start_date:
    desc: 'date where hunting starts (days), from the beginning of the simulation (introduction of the first case)'
    value: 42                   # WARNING: do not forget to simulate until 180 + hunting_start_date
  hunting_duration:
    desc: 'duration of the hunting period (days)'
    value: '30 * 8'


#   _____ _        _
#  / ____| |      | |
# | (___ | |_ __ _| |_ _____   ____ _ _ __ ___
#  \___ \| __/ _` | __/ _ \ \ / / _` | '__/ __|
#  ____) | || (_| | ||  __/\ V / (_| | |  \__ \
# |_____/ \__\__,_|\__\___| \_/ \__,_|_|  |___/

statevars:
  biosecurity:
    desc: 'level of biosecurity in the pig herd'
  is_tested:
    desc: 'boolean variable, 1 if wildboar tested on hunting, 0 otherwise'
  is_outdoor:
    desc: '1 if the pig herd is outdoor, 0 otherwise'
  is_pig_herd:
    desc: 'boolean variable, True (1) if epidemiological unit represents a pig herd, False (0) otherwise'
  is_commercial:
    desc: 'boolean variable, True (1) if the pig herd is commercial, False (0) if backyard'
  is_hunted:
    desc: 'boolean variable, True (1) if the wild boar was killed by hunters, False (0) otherwise'
  is_infected:
    desc: 'boolean variable, True (1) if any animal in the epid_unit is infected (even after all died), False (0) otherwise'
  is_traced:
    desc: '1 if the pig herd has exchanged animals with a detected pig herd within a delay (pig_contact_window), 0 otherwise'
  is_in_protection_area:
    desc: '1 if the pig herd is in a protection area (centered on a detected pig herd)'
  is_in_surveillance_area:
    desc: '1 if the pig herd is in a surveillance area (centered on a detected pig herd)'
  is_within_fences:
    desc: '1 if the epid unit is within installed fences, 0 otherwise'
  is_within_buffer:
    desc: '1 if the epid unit is around installed fences, 0 otherwise'
  date_first_detection:
    desc: 'time when the first detection occurred in the metapopulation, either in pig herds or wildboars (0 if no detection yet)'
  date_traced_end:
    desc: 'time where the "traced" status due to trade contacts ends'
  date_protection_end:
    desc: 'time where the "protection area" status ends'
  date_surveillance_end:
    desc: 'time where the "surveillance area" status ends'
  is_detected:
    desc: 'boolean variable, True (1) if any infectious animal detected in the epidemiological unit'
  is_culled:
    desc: 'boolean variable, True (1) if the epidemiological unit is deliberately culled'
  is_searched:
    desc: 'boolean variable, True (1) if any infectious animal detected in the epidemiological unit'
  date_detected:
    desc: 'day when the unit was detected'
  nb_boars_alive:
    desc: 'total number of boars alive in the metapop, updated over time in the python add-on'
  tile:
    desc: 'tile of the map on which the epidemiological unit is located'
  index:
    desc: 'index of the epidemiological unit in numpy arrays used in the python add-on'
  X:
    desc: 'x coordinate of an epidemiological unit'
  Y:
    desc: 'x coordinate of an epidemiological unit'
  size:
    desc: 'size of an epidemiological unit'
  sold:
    desc: 'number of animals sold by a pig herd over time'
  purchased:
    desc: 'number of animals purchased by a pig herd over time'

#  _____           _        _
# |  __ \         | |      | |
# | |__) | __ ___ | |_ ___ | |_ _   _ _ __   ___  ___
# |  ___/ '__/ _ \| __/ _ \| __| | | | '_ \ / _ \/ __|
# | |   | | | (_) | || (_) | |_| |_| | |_) |  __/\__ \
# |_|   |_|  \___/ \__\___/ \__|\__, | .__/ \___||___/
#                                __/ | |
#                               |___/|_|

prototypes:
  epid_unit:
    - default_epid_unit:
        desc: 'default prototype applied to all epidemiological units at creation'
        changed: yes
        is_outdoor: yes
        is_traced: no
        is_culled: no
        is_tested: 0
        is_in_protection_area: no
        is_in_surveillance_area: no
        date_traced_end: 0
        date_protection_end: 0
        date_surveillance_end: 0
        biosecurity: 0
        is_active: yes
        is_searched: no
        is_carcass: no
        is_detected: no
        is_commercial: no
        is_hunted: no
        is_infected: no
        date_detected: 0
        sold: 0
        purchased: 0
    - pig_herd:
        C_removal_rate: herd_C_removal_rate
        is_pig_herd: 1
    - wild_boar:
        C_removal_rate: wildboar_C_removal_rate
        is_pig_herd: 0
        size: 'wildboar_unit_size'
  metapop:
    - default_metapop:
        desc: 'default metapop prototype'
        date_first_detection: 0

#  _____       _ _   _       _
# |_   _|     (_) | (_)     | |
#   | |  _ __  _| |_ _  __ _| |
#   | | | '_ \| | __| |/ _` | |
#  _| |_| | | | | |_| | (_| | |
# |_____|_| |_|_|\__|_|\__,_|_|

#   _____                _ _ _   _
#  / ____|              | (_) | (_)
# | |     ___  _ __   __| |_| |_ _  ___  _ __  ___
# | |    / _ \| '_ \ / _` | | __| |/ _ \| '_ \/ __|
# | |___| (_) | | | | (_| | | |_| | (_) | | | \__ \
#  \_____\___/|_| |_|\__,_|_|\__|_|\___/|_| |_|___/

initial_conditions:
  ## INITIAL CONDITIONS OF THE METAPOPULATION ARE NOW HANDLED IN THE initialize_level METHOD
  epid_unit:
    - population:
        - vars: [S]
          amount: 'size - initial_exposed'
        - vars: [E]
          amount: 'initial_exposed'
        - vars: [I]
          amount: 0
        - vars: [C]
          amount: 0
        - vars: [D]
          amount: 0

#   ____        _               _
#  / __ \      | |             | |
# | |  | |_   _| |_ _ __  _   _| |_ ___
# | |  | | | | | __| '_ \| | | | __/ __|
# | |__| | |_| | |_| |_) | |_| | |_\__ \
#  \____/ \__,_|\__| .__/ \__,_|\__|___/
#                  | |
#                  |_|

## NOT USED (--no-count)
outputs:
  type: csv
  epid_unit:
    period: 1
...