-
Notifications
You must be signed in to change notification settings - Fork 5
/
Group 22.nlogo
1201 lines (1042 loc) · 32.4 KB
/
Group 22.nlogo
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
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
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
692
693
694
695
696
697
698
699
700
701
702
703
704
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
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
globals [
fileList max-cutomers shope_close total-customers-with-deaths time whitecustomers orangecustomers initialwhite initialorange totalcountcustomer
total-exposure
transmission-rate-local
infectious-radius-local
exposure-time-limit-local
number
arriving-rate
countdeaths
]
breed [customers customer]
customers-own[infection time-in-store sick-time infected? ]
to setup
clear-all
file-open "shelves.csv"
set-default-shape customers "person"
ask patches[ set pcolor white ]
border
while [not file-at-end?][
shelf
]
add-customer
entrygate
file-close-all
reset-ticks
set countdeaths 0
end
to go
if ticks >= nb-hours-before-stop * 1000 [ stop ]
move
rate_of_customer
tick
end
to shelf
let csv file-read-line
set csv word csv ","
let mylist []
while [not empty? csv]
[
let $sep position "," csv
let $item substring csv 0 $sep
carefully [set $item read-from-string $item][]
set mylist lput $item mylist
set csv substring csv ($sep + 1) length csv
]
let x item 0 mylist * 1.75
let y item 1 mylist * 1.75
ask patch x ( y - 20 ) [
let ent item 6 mylist
(ifelse
ent = "Entrance" [
set pcolor green]
ent = "StandardShelf" [
set pcolor pink]
ent = "SlantedShelf" [
set pcolor blue]
ent = "Refridgerator" [
set pcolor yellow]
ent = "Checkout" [
set pcolor yellow]
ent = "CircularStand" [
set pcolor grey]
[set pcolor red])
]
end
to border
ask patches[
if pxcor = 32 and pycor = -25 [set pcolor yellow ]
if (pxcor >= -14 and pxcor <= 33 ) and pycor = -26 [set pcolor grey ]
if (pxcor >= 14 and pxcor <= 33 ) and pycor = -5 [set pcolor grey ]
if (pxcor >= -13 and pxcor <= 13 ) and pycor = -14 [set pcolor grey ]
if (pycor >= -26 and pycor <= -14) and pxcor = -14 [set pcolor grey ]
if (pycor >= -26 and pycor <= -6) and pxcor = 33 [set pcolor grey ]
if (pycor >= -14 and pycor <= -6) and pxcor = 14 [set pcolor grey ]
if (pxcor >= -11 and pxcor <= -8) and (pycor >= 2 and pycor <= 4 )[set pcolor yellow ]
if (pxcor >= 26 and pxcor <= 33) and (pycor >= -5 and pycor <= 8 )
[set pcolor orange]
if (pxcor >= -14 and pxcor <= 13) and (pycor >= -13 and pycor <= 8 )
[set pcolor brown ]
if (pxcor >= 14 and pxcor <= 25) and (pycor >= -4 and pycor <= 8 )
[set pcolor brown ]
if (pxcor >= -13 and pxcor <= 32 ) and (pycor >= -25 and pycor <= -15 )
[set pcolor black ]
if (pxcor >= 15 and pxcor <= 32 ) and (pycor >= -14 and pycor <= -6 )
[set pcolor black ]
if (pxcor >= 28 and pxcor <= 31) and (pycor >= -13 and pycor <= -6 )
[set pcolor red ]
]
end
to entrygate
ask patches[
if (pxcor >= -13 and pxcor <= -11) and pycor = -14 [set pcolor green ]
if (pxcor >= 15 and pxcor <= 17 ) and pycor = -5 [set pcolor gray ]
if (pxcor >= 23 and pxcor <= 24 ) and pycor = -5 [set pcolor gray ]
]
end
to add-customer
create-customers max-customers
[
customer-setting
]
set totalcountcustomer count customers
set initialwhite count customers with [color = white]
set initialorange count customers with [color = orange]
set time closing_time * 100
set number 0
rate_of_customer
end
to customer-setting
let p one-of patches with [pcolor = brown]
let x [ pxcor ] of p
let y [ pycor ] of p
setxy x y
set sick-time 0
set color white
set size 1
set infected? false
set time-in-store random 500
set infection random 100
if infection > 100 - percentage_of_infected
[
set color orange
set infected? true
]
end
to-report customercounter[num addnum]
set num num + addnum
report num
end
to rate_of_customer
ifelse (number = 20 and time > 0) [
set arriving-rate random max-arrival-rate
if change-arrival-rate? [
set arriving-rate modified-arrival-rate
]
create-customers arriving-rate [
customer-setting
]
set totalcountcustomer totalcountcustomer + arriving-rate
set number 0
]
[
set number number + 1;
]
end
to move
ask customers [
; move-to one-of patches with [pcolor = green]
let s count customers
set time-in-store time-in-store - 1
ifelse ( ( pcolor = brown or pcolor = green or pcolor = black or pcolor = grey or pcolor = white or pcolor = yellow or pcolor = red or pcolor = orange) and time-in-store > 0) [
if pcolor = brown [
; let x one-of [pxcor] of patches with [pcolor = green]
; let y one-of [pycor] of patches with [pcolor = green]
; facexy x y
; fd 1
;face [one-of patches with [pcolor = green]]
set heading towards one-of patches with [pcolor = green]
fd 5
]
if(pcolor = gray)
[
set heading 180
fd 1
]
if ( pcolor = green )[
set heading 180
fd 2
]
if ( pcolor = black )[
set heading random 360
fd 1
]
if( pcolor = grey or pcolor = white or pcolor = yellow )
[ bk 2 ]
; if ([pcolor] of patch-ahead 1 != grey and [pcolor] of patch-ahead 1 != white and [pcolor] of patch-ahead 1 != yellow)[
; bk 5
; ]
if pcolor = red [
let x one-of [pxcor] of patches with [pcolor = orange]
let y one-of [pycor] of patches with [pcolor = orange]
facexy x y
fd 1
]
if pcolor = orange [
if color = white [set whitecustomers whitecustomers + 1]
if color = orange [set orangecustomers orangecustomers + 1]
set total-customers-with-deaths total-customers-with-deaths + 1
die
; set countdeaths countdeaths + 1
; print countdeaths
]
; if s < max-customers and time > 0
; [
; hatch max-customers - s [
; set totalcountcustomer totalcountcustomer + max-customers - s
; let p one-of patches with [pcolor = brown]
; let x4 [ pxcor ] of p
; let y4 [ pycor ] of p
; setxy x4 y4
; set color white
; set size 1
; set time-in-store random 500
; set infection random 100
; if infection > 100 - percentage_of_infected
; [
; set color orange
; ]
; ;customer-setting
; ]
; ]
]
[
ifelse ( time-in-store <= 0 and ( pcolor = black or pcolor = 135 or pcolor = 105 or pcolor = red or pcolor = 45 or pcolor = 5 or pcolor = gray))
[
let x one-of [pxcor] of patches with [pcolor = red]
let y one-of [pycor] of patches with [pcolor = red]
facexy x y
fd 1
if (pcolor = red )
[let x2 one-of [pxcor] of patches with [pcolor = orange]
let y2 one-of [pycor] of patches with [pcolor = orange]
facexy x2 y2
fd 1
]
if (pcolor = orange) [
; fd random 10
; stop
if color = white [set whitecustomers whitecustomers + 1]
if color = orange [set orangecustomers orangecustomers + 1]
set total-customers-with-deaths total-customers-with-deaths + 1
die
]
]
[
ifelse( time-in-store <= 0 and ( pcolor = brown or pcolor = green ))
[ set time-in-store 10]
[set heading 90 fd 1]
]
]
]
infect-others
shop_closeing_time
remove-bug
end
to infect-others
ask customers with [color = white ] [
if (pcolor = black or pcolor = 135 or pcolor = 105 or pcolor = red or pcolor = 45 or pcolor = 5 or pcolor = gray) [
check-mask
if any? other customers in-radius infectious-radius-local with [color = orange] [
;exposure time
set sick-time sick-time + 0.1 ;; make it in minutes divide with 60 consider 15 min max exposure time ;; maths
; set infection infection + rate-of-increment-if-in-contact
set total-exposure total-exposure + sick-time
if sick-time > exposure-time-limit-local [
if random 100 < transmission-rate-local [
set infected? true
set color orange
]
]
]
]
]
end
to check-mask
ifelse mask? [
set transmission-rate-local transmission-when-mask
set infectious-radius-local infectiousradius-when-mask
set exposure-time-limit-local exposure-time-limit-when-mask
][
set transmission-rate-local transmission-rate
set infectious-radius-local infectious-radius
set exposure-time-limit-local exposure-time-limit
]
end
to shop_closeing_time
set time time - 1
if time < 0[
ask customers [
if pcolor != brown and pcolor != green[
let x one-of [pxcor] of patches with [pcolor = red]
let y one-of [pycor] of patches with [pcolor = red]
facexy x y
fd 1
]
]
]
end
to remove-bug
ask customers [
if pcolor = white
[ die
set countdeaths countdeaths + 1
print countdeaths
]
]
if (count customers = 0) [
stop
]
end
@#$#@#$#@
GRAPHICS-WINDOW
382
15
806
336
-1
-1
8.0
1
10
1
1
1
0
0
0
1
-16
35
-28
10
1
1
1
ticks
30.0
BUTTON
45
12
140
45
NIL
setup
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SLIDER
175
14
347
47
max-customers
max-customers
0
100
50.0
1
1
NIL
HORIZONTAL
BUTTON
40
60
148
93
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
250
159
355
204
No of Customers in Store
count customers with \n[pcolor != brown and pcolor != green]
17
1
11
SLIDER
191
103
363
136
nb-hours-before-stop
nb-hours-before-stop
0
24
14.0
1
1
NIL
HORIZONTAL
SLIDER
840
14
1024
47
percentage_of_infected
percentage_of_infected
0
100
25.0
1
1
NIL
HORIZONTAL
SLIDER
845
58
1017
91
infectious-radius
infectious-radius
0
5
2.0
0.5
1
NIL
HORIZONTAL
PLOT
652
351
1029
613
Customers in Shop
NIL
NIL
0.0
10.0
0.0
10.0
true
true
"" ""
PENS
"Infected Customer" 1.0 0 -955883 true "" "plot count customers with [color = orange]"
"Susceptible Customer" 1.0 0 -5825686 true "" "plot count customers with [color = white]"
"Total customers " 1.0 0 -7500403 true "" "plot count customers"
SLIDER
847
143
1019
176
exposure-time-limit
exposure-time-limit
0
10
3.0
1
1
NIL
HORIZONTAL
SLIDER
845
99
1017
132
transmission-rate
transmission-rate
0
5
2.0
1
1
NIL
HORIZONTAL
SLIDER
179
60
351
93
closing_time
closing_time
0
24
13.0
1
1
NIL
HORIZONTAL
PLOT
1059
189
1385
427
Customers after they leave the store
NIL
No. of Customers
0.0
10.0
0.0
10.0
true
true
"" ""
PENS
"Susceptible" 1.0 0 -13791810 true "" "plot whitecustomers"
"Total" 1.0 0 -1184463 true "" "plot orangecustomers + whitecustomers"
"Infected" 1.0 0 -2674135 true "" "plot orangecustomers"
SLIDER
1061
100
1246
133
transmission-when-mask
transmission-when-mask
0
5
1.0
1
1
NIL
HORIZONTAL
SWITCH
1050
10
1153
43
mask?
mask?
1
1
-1000
SLIDER
1051
58
1259
91
infectiousradius-when-mask
infectiousradius-when-mask
0
5
0.5
0.5
1
NIL
HORIZONTAL
SLIDER
1047
144
1262
177
exposure-time-limit-when-mask
exposure-time-limit-when-mask
0
10
10.0
1
1
NIL
HORIZONTAL
PLOT
12
151
245
344
Total exposure time
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" "plot total-exposure / 10"
PLOT
15
362
300
585
Customer Arrivial Rate
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" "plot arriving-rate"
PLOT
316
350
639
614
Infection Rate
NIL
NIL
0.0
10.0
0.0
1.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" "plot orangecustomers / ( 1 + orangecustomers + whitecustomers)"
SLIDER
851
246
1023
279
modified-arrival-rate
modified-arrival-rate
0
10
1.0
1
1
NIL
HORIZONTAL
SWITCH
849
202
1018
235
change-arrival-rate?
change-arrival-rate?
1
1
-1000
SLIDER
7
105
179
138
max-arrival-rate
max-arrival-rate
0
10
7.0
1
1
NIL
HORIZONTAL
PLOT
1058
435
1384
630
Infection per customer
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" "set-plot-x-range 0 totalcountcustomer"
PENS
"default" 1.0 1 -16777216 true "" "histogram [ infection ] of customers "
@#$#@#$#@
# ABMS Project
## RESEARCH PAPER PROPOSAL: [Modelling COVID-19 transmission in supermarkets using an agent-based model](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0249821)
---
GROUP MEMEBERS
- Dishant Tayade
- Hardik Sharma
- Satyam Kumar Singh
- Nishchay Verma
---
## PURPOSE AND PATTERNS
As the main provider of food and essential goods, supermarkets remained open in many countries throughout the COVID-19 pandemic in 2020, while the majority of other businesses (such as general retail stores) shut down during periods of government-mandated lockdowns . Supermarkets represent one of the main hubs where a large number of people mix indoors throughout the pandemic and COVID-19, may be transmitted. It is therefore vital to find safe ways for customers to shop and minimize virus transmission. Models for customer dynamics and virus transmission are useful towards that goal, as they can be used to estimate the infection risk and assess how different interventions affect the risk.
Thus, we propose an agent-based model for customer dynamics which we use to estimate the total amount of exposure time, which we define as the total amount of time that customers are in close proximity to infected customers. Using a simple virus transmission model, we estimate the number of infections from exposure time. We apply this model to synthetic data and how to model the following interventions:
- Restricting the maximum number of customers in the store (MOBILITY MODEL),
We aim to find the rate of customer entering the store and at max how many customers can be present inside store at-a-time, and its dependency on the spread of virus.
- Reducing the rate at which customers enter the store (TRANSMISSION MODEL),
We focus on
- Implementing face mask policy, and
- One-way aisle store layout.
## ENTITY, STATE VARIABLES AND SCALES
### Agents
We have customers that enter the store , until store remains open.
The customers goes inside the store from entry gate, do their shopping for some time, checkout at billing area and exit from the exit door.
Initially some of the customers may/may not be infected with COVID 19 virus.
The customers randomly shop inside the shopping store going from shop to shop.
### Store graph
We represent a store as a network (called a store graph), in which nodes represent zones and edges connect contiguous zones. We create a store graph from a synthetic store layout following a similar procedure. Zones are approximately 2m by 2m and we specify a number of entrance, till, and exit nodes. We choose a network representation of a store for ease of simulation, as it significantly reduces the complexity of the model.
![abms2.png](abms2.png)
![Untitled](Untitled.png)
The coordinates of the store map are imported from " shelves.csv " file.
We added some border , entry and exit area with different colors so it is easy to simulate the customer movement and virus transmission.
### Patch
The patch coordinates are altered so that the imported coordinates of map can be easily managed within the patch size and it is visually good.
### Environment
**ENTRY AREA [ BROWN ]**
The customers spawn in the entry area. From there they move towards the store.
**ENTRY GATE [ GREEN ]**
The customers move inside the store from the entry gate.
**SHOPPING GALLERY [ BLACK ]**
The customers roam freely and randomly in every directions and do their shopping. The path is the shopping gallery.
**SHOPS [ PINK , BLUE , GREY , YELLOW ]**
The shops are of different colors. Each color specify zones (like children section, ladies section, grocery, sports area, kitchen items etc. ).
**CHECKOUT AREA [ RED ]**
The checkout area is the billing area. After shopping their items , customers do the billing at checkout area.
**STORE BORDER [ GREY ]**
The border is the boundary of the store, so that customers roam freely inside the store and do not move out of store while shopping.
**EXIT AREA [ ORANGE ]**
Exit area is the place from where people move out of the store after shopping.
### Collectives
There may be two groups of customers, one of them non-infected and other be infected.
Non-infected one are of *white color* and infected one are of *orange color*.
## PROCESS, OVERVIEW AND SCHEDULING
Our agent-based model has four major components: a customer mobility model, a virus transmission model, face mask policy and one-way aisle layout.
The first component is the customer mobility model for how customers arrive at the store and move.
The second component is a model for how the virus transmits in the supermarket.
The third component shows the effect of using masks on the transmission of virus.
The last component shows if customers move only in one direction , then how it will affect the transmission.
### CUSTOMER - MOBILITY MODEL
In our agent-based model, customers arrive the store according to a Poisson process with constant rate "customer/min" . Each customer starts at a random entrance node (chosen uniformly at random from all entrance nodes) and follows a random shopping path. Each shopping path is a path in the store graph, representing the route that a customer takes in the store. Two consecutive nodes in the shopping path may be identical. This case occurs when a customer picks up one or more items in the zone. A customer traverses the store graph according to its assigned shopping path. At the beginning of each simulation, the store is empty and customers arrive in the store over a period of H hours (corresponding to length of the opening hours of the store). After H hours, no new customers arrive and the simulation stops once the last customer leaves the store.
### **TRANSMISSION MODEL**
In our model, Customer are either susceptible or infectious when they enter the store. Each customer that arrives to the store is infectious with independent probability "percentage_of_infected" (corresponding to the proportion of infectious customers) and is otherwise susceptible. In our infection mechanism, we assume susceptible customers become infected proportional to the time they spent with infectious customers. We assume that the main mode of transmission is direct transmission via respiratory droplets and neglect airborne transmission and fomite transmission. More formally, we define the *exposure time ( sick-time )* for each susceptible customer .
as the total time that customer was in the same radius as an infectious customer during the shopping trip . If they have positive exposure time. Each exposed customer becomes infected after the shopping trip with probability of "transmission-rate" for some transmission rate . In other words, we model the infection probability of an exposed customer as a linear function of the exposure time with infectious customers. In reality, the infection probability function may take some other form (e.g., a logistic function), but for simplicity and due to lack of validated alternative models, we choose a linear function.
## DESIGN CONCEPTS
### BASIC
- The coordinates of map are imported and patch size and min, max patch coordinates are also altered so that the store map is manageable inside the patch area.
- Custom borders are made of grey color to avoid customer from moving out of the store. As initially, we had only coordinates of the shops .
We used "border" function for the same by providing custom coordinates of the patches and then changing the colors of the patches to grey.
- Entry gates are made by changing the colors of patches to green. Function "entrygate" is used for the same.
### **CUSTOMER MOBILITY MODEL**
- **Create Customer**
We made the "add-customer" named function, that creates new customers. The customers are randomly created over the entry area. The customers have shape of "person" and have "white" color and size 1.
- **Move Customer**
After creation of the customers , the customers move towards any of the nearest entry gate. The customers stay inside the store for atmax "time-in-store" time.
The customer leave the store if either their shopping is done or the stay time exceeds that value , the customers move towards the exit.
- **Restricting the maximum number of customers in store**
We restrict the maximum number *C*max of customers in a store. We can add this restriction to our model by simulating a queue outside of the store, where customers queue up if we have *C*max or more customers in the store. Customers from the queue only enter the store when the number of customers in the store is below *C*max. In our model, the estimated chance of infection and number of infections also decreases significantly when decreasing the maximum number of customers in the store. We also note that the mean number of infections plateaus as we increase the *C*max beyond 20, as the number of customers typically does not exceed 20 in our simulations
We made a variable "max-customer" for the same.
- **Reducing customer arrival rate**
Another way of reducing the number of customers in the store is to restrict the rate at which customers enter the store. We can incorporate this in our model by varying the arrival rate λ. We see that the chance of infection increases linearly with λ while the number of infections increases quadratically . The linear and quadratic scaling are not unsurprising: The number of customers (both infectious customers and susceptible customers) in the store increases linearly with the arrival rate. Therefore, we expect the exposure time (and hence the chance of infection) for each susceptible customer to increase linearly with the arrival rate λ.
We made a variable "customer/min" for the same. After every tick new "customer/minutes" new customer will enter the store.
- **Total store open time**
The store will remain open for "closing-time" hours and until then new customers will continuously spawn over the entry area.
### TRANSMISSION MODEL
- **Infecting others**
If a customer is infected and if a non infected customer comes in contact ( certain radius ) with him then the non infected customer's is now exposed. When a susceptible customer is exposed or positive exposure time he can get infected with a probability of "transmission-rate".
### FACE MASK MODEL
Masks can be implemented to stop/ decrease the spread of virus as masks will avoid direct contact to virus resulting in decreasing the spread of virus.
# INPUT DATA
We are using synthetically created store layout and shopping path. The store is a small store with around 80 shelves, 4 tiles and 3 entrances and 1 exit. which we are taking from "shelves.csv" file. Other inputs such as Customer customer/min , transmission rate, percentage of infected customers, radius of infection/exposure etc. are taken using sliders. .
# INITIALIZATION
In the initial state of the model world, we use a synthetically-created store layout. The store is small and has around 80 shelves, 4 tills, 2 entrances and one exit. There are not any customers in supermarket. Customers are eighter susceptible of infectious when they enter the store and the customers initially are infected by a probability of "percentage-of-infected". Customer customer/min is defined, which is the number of customer entering the store per minute. "percentage-of-infected-customers" is defined, which is the percentage infected initially. Opening time of store is defined and virus transmission rate is defined. Option to turn on masks and turn off masks can be done.
@#$#@#$#@
default
true
0
Polygon -7500403 true true 150 5 40 250 150 205 260 250
airplane
true
0
Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15
arrow
true
0
Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150
box
false
0
Polygon -7500403 true true 150 285 285 225 285 75 150 135
Polygon -7500403 true true 150 135 15 75 150 15 285 75
Polygon -7500403 true true 15 75 15 225 150 285 150 135
Line -16777216 false 150 285 150 135
Line -16777216 false 150 135 15 75
Line -16777216 false 150 135 285 75
bug
true
0
Circle -7500403 true true 96 182 108
Circle -7500403 true true 110 127 80
Circle -7500403 true true 110 75 80
Line -7500403 true 150 100 80 30
Line -7500403 true 150 100 220 30
butterfly
true
0
Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240
Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240
Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163
Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165
Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225
Circle -16777216 true false 135 90 30
Line -16777216 false 150 105 195 60
Line -16777216 false 150 105 105 60
car
false
0
Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180
Circle -16777216 true false 180 180 90
Circle -16777216 true false 30 180 90
Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89
Circle -7500403 true true 47 195 58
Circle -7500403 true true 195 195 58
circle
false
0
Circle -7500403 true true 0 0 300
circle 2
false
0
Circle -7500403 true true 0 0 300
Circle -16777216 true false 30 30 240
cow
false
0
Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167
Polygon -7500403 true true 73 210 86 251 62 249 48 208
Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123
cylinder
false
0
Circle -7500403 true true 0 0 300
dot
false
0
Circle -7500403 true true 90 90 120
face happy
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240
face neutral
false
0
Circle -7500403 true true 8 7 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Rectangle -16777216 true false 60 195 240 225
face sad
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183
fish
false
0
Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166
Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165
Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60
Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166
Circle -16777216 true false 215 106 30
flag
false
0
Rectangle -7500403 true true 60 15 75 300
Polygon -7500403 true true 90 150 270 90 90 30
Line -7500403 true 75 135 90 135