-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project_code_Matteo_Antonio_Inajetovic_CSNS2021.nlogo
1320 lines (1146 loc) · 31.1 KB
/
Project_code_Matteo_Antonio_Inajetovic_CSNS2021.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
; Name: Matteo Antonio Inajetovic
; ID: 0000949648
; Course: Artificial Intelligence
extensions [ nw ]
breed [computers computer]
directed-link-breed [ directed-edges directed-edge ]
undirected-link-breed [ undirected-edges undirected-edge ]
;; //// Variables ////
computers-own
[
infected? ;; if true, the agent is infectious
resistant? ;; if true, the agent can't be infected
virus-check-timer ;; number of ticks since this computer's last virus-check
dead? ;; if true, the agent is dead.
infected-ticks ;; number of ticks since the computer has been infected
age ;; age of the computer
centrality-value ;; centrality value for the computer
immune-ticks ;; number of ticks since the computer has become resistant
control? ;; a sample of computers can be checked to block the virus spread
degree ;; degree property of the agent used to build the function which gives the chance to choose where the infection will start
]
globals
[
history ;list of initial outbreak infected - computed for a visualization purpose
infected ;list of agents which transimitted the infection to other agents
infect ;list of agents get infected
block ;boolean variable to block the infected's out-links
threshold ;centrality threshold
vd ;number of virus deaths
]
;; //// Setup section ////
to setup
clear-all
;global variables initialization
set history []
set infect []
set infected []
set block False
set-current-plot "Degree distribution"
setup-pa-network
ask computers [
set degree count link-neighbors
]
;; Initial Outbreak of the Virus
initial-outbreak
;; Age random initialization
ask computers [ set age random age-to-die - 200]
ask links [ set color white ]
; IIT tagging
ask computers [ set control? False ]
if isolation
[
ask n-of ( tool-efficiency * number-of-nodes / 100 ) computers [ set control? True ]
set threshold centrality-threshold ;; computation of centrality threshold
]
reset-ticks
end
;; //// Setup: Preferential Attachment Network ////
to setup-pa-network
make-node nobody ;; first node, unattached
make-node computer 0 ;; second node, attached to first node
while [count computers < number-of-nodes ]
[
make-node find-partner
]
; make the network look a little prettier
repeat 10
[
layout-spring computers links 0.3 (world-width / (sqrt number-of-nodes)) 1
;let factor sqrt count computers
;if factor = 0 [ set factor 1 ]
;layout-spring computers links (1 / factor) (14 / factor) (1.5 / factor)
]
layout
end
to make-node [old-node]
;; function to allow the preferential attachment method to create the network by adding nodes
set-default-shape computers "square"
create-computers 1
[
; for visual reasons, we don't put any nodes *too* close to the edges
setxy (random-xcor * 0.95) (random-ycor * 0.95)
become-susceptible
set virus-check-timer random virus-check-frequency
if old-node != nobody
[
ifelse enable-directed-links and not dead?
[create-link-from old-node [ set color white ] if random 100 < 90 [create-link-to old-node [ set color white ]] ]
[create-link-with old-node [ set color white ]]
;; position the new node near its partner
move-to old-node
fd 8
]
]
layout
end
to-report find-partner
report [one-of both-ends] of one-of links
end
to layout
;; the number 3 here is arbitrary; more repetitions slows down the
;; model, but too few gives poor layouts
repeat 3 [
;; the more computers we have to fit into the same amount of space,
;; the smaller the inputs to layout-spring we'll need to use
let factor sqrt count computers
;; numbers here are arbitrarily chosen for pleasing appearance
layout-spring computers links (1 / factor) (7 / factor) (1 / factor)
;display ;; for smooth animation
]
;; don't bump the edges of the world
let x-offset max [xcor] of computers + min [xcor] of computers
let y-offset max [ycor] of computers + min [ycor] of computers
;; big jumps look funny, so only adjust a little each time
set x-offset limit-magnitude x-offset 1.0
set y-offset limit-magnitude y-offset 1.0
ask computers [ setxy (xcor - x-offset / 2) (ycor - y-offset / 2) ]
end
to-report limit-magnitude [number limit]
if number > limit [ report limit ]
if number < (- limit) [ report (- limit) ]
report number
end
;; //// Go section ////
to go
if all? computers [not infected?]
[ stop ]
ask computers
[
set age age + 1
set virus-check-timer virus-check-timer + 1
set infected-ticks infected-ticks + 1
if virus-check-timer >= virus-check-frequency
[ set virus-check-timer 0 ]
]
spread-virus ;; Virus diffusion
do-virus-checks ;; Virus checks, isolation part of the Tracing Tool and deaths caused by the virus.
natural-death ;; Some computers can leave the network because of "natural death", without the virus' intervention
isolate ;; The Infection Tracing Tool, at each timestep checks whether to block the tagged computers or not.
new-computers ;; At each timestep, new computers can join the network with a certain rate
loss-resistants ;; Some computers can loose their resistance to the virus (SIRS model)
tick
end
;; //// Computer's states ////
to become-infected ;; computer procedure
set infected? true
set resistant? false
set color red
set infected-ticks 1
set dead? false
end
to become-susceptible ;; computer procedure
set infected? false
set resistant? false
set color blue
ask my-links [ set color gray ]
set infected-ticks 0
set dead? false
end
to become-resistant ;; computer procedure
set infected? false
set resistant? true
set color green
ask my-links [ set color gray ]
set infected-ticks 0
set dead? false
end
to become-dead ;; computer procedure
set infected? false
set resistant? false
set dead? true
set color gray - 3
ask my-links [ die ]
end
;; //// Functions' section ////
to initial-outbreak
;; This function has been realized to give the opportunity to choose the region of the network where the initial infected nodes will be.
;; So the computation of all nodes' degree has not to be seen as a tool's property, it is only used for a studying purpose.
let degree-list sort [count link-neighbors] of computers
let deg-position (number-of-nodes - 5)
let top-five item deg-position degree-list
let hubs computers with [ degree > top-five ]
let periphery computers with [ degree < top-five ]
let section "0"
ifelse initial-infected = "hubs"
[set section hubs]
[set section periphery]
ask n-of initial-outbreak-size section
[ become-infected
set history lput who history]
end
to spread-virus ; S->I
ask computers with [infected?]
[ let origin who
ask out-link-neighbors with [not resistant? and not infected? and not dead?]
[ if random-float 100 < virus-spread-chance
[ become-infected
;; --- IIT: infection tracing ----
ask my-out-links [ set color red ]
set infected lput who infected
set infect lput origin infect
]
]
]
end
to isolate
;; IIT: if isolation is on and a "central" node is infected (its centrality value is higher
;; than the threshold given by the centrality-threshold function)
;; the boolean variable block is set to True and the infected outlinks are
;; canceled in order to avoid the virus spread
ask computers with [infected?]
[
if centrality-value > threshold and isolation = True [
set block True
]
]
end
to-report centrality-threshold
;; IIT: this function computes the beetweenness centrality
;; measure for all the sampled computers and store those values
;; in a sorted list. It returns a threshold value of
;; centrality.
nw:set-context computers links;get-links-to-use
ask computers with [ control? = True ] [
set centrality-value (runresult [ -> nw:betweenness-centrality ])
]
let blist []
ask computers [ set blist lput centrality-value blist ]
set blist sort blist
let th-position (number-of-nodes - 5) ;; the threshold is set to the fifth higher value of centrality
let th item th-position blist
print th
report th
end
to loss-resistants
;; some resistant computers can become susceptible again
ask computers with [ resistant? ] [
set immune-ticks immune-ticks + 1
]
ask computers with [control? = False and resistant? and immune-ticks > temporary-immune-period ]
;;assumption: controlled computers cannot lose their resistance
[
if random 100 < loss-immune-rate
[
become-susceptible
set immune-ticks 0
]
]
end
to do-virus-checks
;; IIT: isolation -> if the isolation tool is on, some infected computers
;; can be isolated by removing their outlinks, furthermore they cannot
;; send emails and spread the virus.
ask computers with [infected? and control? = True and virus-check-timer = 0 ]
;; only controlled computers can be blocked by the tool
[
if block and random 100 < 50 ;; 50% probability to succede in the block procedure.
[ ask my-out-links [ die ]
set color orange ]
]
;; I->R
;; recovery section>
ask computers with [infected? and virus-check-timer = 0]
[
if random 100 < recovery-chance
[ become-resistant ]
]
;; computers which are infected for a certain time, without being recovered,
;; can die depending on the virus-death-rate slider.
ask computers with [infected? and infected-ticks >= sick-ticks-to-die]
[
if random 100 < virus-death-rate
[become-dead
set vd vd + 1]
]
end
to natural-death
;; Some computers can leave the network because of "natural death", without the virus' influence
ask computers with [ age >= age-to-die]
[
if random 100 < death-rate
[become-dead]
]
end
to new-computers
;; At each timestep, new computers can join the network with a certain rate
if random 100 < birth-rate [
make-node
find-partner
]
end
to infection-graph
;; Infection Graph or Transmission Network visualization
clear-links
clear-plot
foreach history [ x ->
ask computer x [set color yellow set shape "triangle"]
]
foreach infected [ x ->
ask computer x [set shape "circle"]
ask computer x [set color yellow]
let i position x infected
let previous item i infect
ask computer x [ create-link-to computer previous [ set color red ] ]
]
ask computers with [ color != yellow ] [ die ]
let factor sqrt count computers
if factor = 0 [ set factor 1 ]
layout-spring computers links (1 / factor) (14 / factor) (1.5 / factor)
;let root-agent max-one-of computers [ count my-links ]
;layout-radial computers links root-agent
end
;; //// Measures and tools from NW Extension ////
to betweenness
centrality [ -> nw:betweenness-centrality ]
end
to pagerank
centrality [ -> nw:page-rank ]
end
to eigenvector
centrality [ -> nw:eigenvector-centrality ]
end
to closeness
centrality [ -> nw:closeness-centrality ]
end
to-report get-links-to-use
report ifelse-value enable-directed-links
[ directed-edges ]
[ undirected-edges ]
end
to-report global-clustering-coefficient
nw:set-context computers links
let closed-triplets sum [ nw:clustering-coefficient * count my-links * (count my-links - 1) ] of computers
let triplets sum [ count my-links * (count my-links - 1) ] of computers
print closed-triplets
print triplets
report closed-triplets / triplets
end
to centrality [ measure ]
nw:set-context computers links;get-links-to-use
ask computers [
let res (runresult measure) ; run the task for the computer
ifelse is-number? res [
set label precision res 2
set size res ; this will be normalized later
]
[
set label res
set size 1
]
]
normalize-sizes-and-colors
end
to normalize-sizes-and-colors
if count computers > 0 [
let sizes sort [ size ] of computers ; initial sizes in increasing order
let delta last sizes - first sizes ; difference between biggest and smallest
ifelse delta = 0 [ ; if they are all the same size
ask computers [ set size 1 ]
]
[ ; remap the size to a range between 0.5 and 2.5
ask computers [ set size ((size - first sizes) / delta) * 2 + 0.5 ]
]
ask computers [ set color scale-color red size 0 5 ] ; using a higher range max not to get too white...
]
end
; Copyright 2008 Uri Wilensky.
; See Info tab for full copyright and license.
@#$#@#$#@
GRAPHICS-WINDOW
265
10
724
470
-1
-1
11.0
1
10
1
1
1
0
0
0
1
-20
20
-20
20
1
1
1
ticks
30.0
SLIDER
25
262
230
295
loss-immune-rate
loss-immune-rate
0.0
100
50.0
1
1
%
HORIZONTAL
SLIDER
25
227
230
260
recovery-chance
recovery-chance
0.0
10.0
1.0
0.1
1
%
HORIZONTAL
SLIDER
25
157
230
190
virus-spread-chance
virus-spread-chance
0.0
10.0
5.0
0.1
1
%
HORIZONTAL
BUTTON
25
114
120
154
NIL
setup
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
135
114
230
154
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
0
PLOT
946
323
1187
470
Network Status
time
% of nodes
0.0
52.0
0.0
100.0
true
true
"" ""
PENS
"susceptible" 1.0 0 -13345367 true "" "plot (count turtles with [not dead? and not infected? and not resistant?]) / (count turtles) * 100"
"infected" 1.0 0 -2674135 true "" "plot (count turtles with [infected?]) / (count turtles) * 100"
"resistant" 1.0 0 -13840069 true "" "plot (count turtles with [resistant?]) / (count turtles) * 100"
SLIDER
25
10
230
43
number-of-nodes
number-of-nodes
10
300
160.0
5
1
NIL
HORIZONTAL
SLIDER
25
192
230
225
virus-check-frequency
virus-check-frequency
1
20
5.0
1
1
ticks
HORIZONTAL
SLIDER
25
80
230
113
initial-outbreak-size
initial-outbreak-size
1
number-of-nodes
3.0
1
1
NIL
HORIZONTAL
SWITCH
25
297
195
330
enable-directed-links
enable-directed-links
0
1
-1000
SLIDER
729
42
901
75
age-to-die
age-to-die
0
1000
1000.0
1
1
NIL
HORIZONTAL
SLIDER
729
80
901
113
sick-ticks-to-die
sick-ticks-to-die
0
500
300.0
1
1
NIL
HORIZONTAL
SLIDER
729
117
901
150
birth-rate
birth-rate
0
100
8.0
1
1
%
HORIZONTAL
PLOT
945
10
1145
160
Degree Distribution
degree
number of nodes
0.0
10.0
1.0
10.0
true
false
"" ""
PENS
"pen-1" 1.0 0 -16645628 true "" "let max-degree max [count link-neighbors] of turtles\nplot-pen-reset ;; erase what we plotted before\nset-plot-x-range 1 (max-degree + 1) ;; + 1 to make room for the width of the last bar\nhistogram [count link-neighbors] of turtles"
SLIDER
729
190
901
223
death-rate
death-rate
0
5.0
0.4
0.1
1
%
HORIZONTAL
SWITCH
24
399
127
432
isolation
isolation
1
1
-1000
PLOT
945
166
1189
316
Number of dead/alive computers
time
% of nodes
0.0
10.0
0.0
10.0
true
true
"" ""
PENS
"alive" 1.0 0 -13840069 true "" "plot (count turtles with [ not dead?]) "
"virus-deaths" 1.0 0 -7500403 true "" "plot ( vd ) "
SLIDER
729
154
901
187
virus-death-rate
virus-death-rate
0
100
30.0
1
1
%
HORIZONTAL
BUTTON
728
266
844
299
NIL
infection-graph\n
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
728
302
827
335
NIL
betweenness
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
728
438
799
483
NIL
count links
17
1
11
SLIDER
25
45
230
78
temporary-immune-period
temporary-immune-period
0
500
200.0
1
1
ticks
HORIZONTAL
MONITOR
854
389
910
434
NIL
vd
17
1
11
MONITOR
729
388
779
433
td
count computers with [ dead? ]
17
1
11
MONITOR
729
339
786
384
%
vd / count computers with [ dead? ]
17
1
11
MONITOR
807
438
903
483
NIL
count computers
17
1
11
MONITOR
784
388
841
433
S/I
count turtles with [not dead? and not infected? and not resistant?] / count turtles with [infected?]
17
1
11
SLIDER
24
435
196
468
tool-efficiency
tool-efficiency
0
100
70.0
1
1
%
HORIZONTAL
TEXTBOX
76
381
226
399
Infection-Tracing Tool\n
11
0.0
1
TEXTBOX
775
15
925
33
Births/Deaths\n
11
0.0
1
TEXTBOX
748
243
898
261
Infection-Graph and measures
11
0.0
1
CHOOSER
25
331
163
376
initial-infected
initial-infected
"hubs" "periphery"
1
MONITOR
789
339
900
384
number infections
length infected
17
1
11
BUTTON
830
302
927
335
NIL
eigenvector\n
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
@#$#@#$#@
## WHAT IS IT?
This model demonstrates the spread of a virus through a network. Although the model is somewhat abstract, one interpretation is that each node represents a computer, and we are modeling the progress of a computer virus (or worm) through this network. Each node may be in one of three states: susceptible, infected, or resistant. In the academic literature such a model is sometimes referred to as an SIR model for epidemics.
## HOW IT WORKS
Each time step (tick), each infected node (colored red) attempts to infect all of its neighbors. Susceptible neighbors (colored green) will be infected with a probability given by the VIRUS-SPREAD-CHANCE slider. This might correspond to the probability that someone on the susceptible system actually executes the infected email attachment.
Resistant nodes (colored gray) cannot be infected. This might correspond to up-to-date antivirus software and security patches that make a computer immune to this particular virus.
Infected nodes are not immediately aware that they are infected. Only every so often (determined by the VIRUS-CHECK-FREQUENCY slider) do the nodes check whether they are infected by a virus. This might correspond to a regularly scheduled virus-scan procedure, or simply a human noticing something fishy about how the computer is behaving. When the virus has been detected, there is a probability that the virus will be removed (determined by the RECOVERY-CHANCE slider).
If a node does recover, there is some probability that it will become resistant to this virus in the future (given by the GAIN-RESISTANCE-CHANCE slider).
When a node becomes resistant, the links between it and its neighbors are darkened, since they are no longer possible vectors for spreading the virus.
## HOW TO USE IT
Using the sliders, choose the NUMBER-OF-NODES and the AVERAGE-NODE-DEGREE (average number of links coming out of each node).
The network that is created is based on proximity (Euclidean distance) between nodes. A node is randomly chosen and connected to the nearest node that it is not already connected to. This process is repeated until the network has the correct number of links to give the specified average node degree.
The INITIAL-OUTBREAK-SIZE slider determines how many of the nodes will start the simulation infected with the virus.
Then press SETUP to create the network. Press GO to run the model. The model will stop running once the virus has completely died out.
The VIRUS-SPREAD-CHANCE, VIRUS-CHECK-FREQUENCY, RECOVERY-CHANCE, and GAIN-RESISTANCE-CHANCE sliders (discussed in "How it Works" above) can be adjusted before pressing GO, or while the model is running.
The NETWORK STATUS plot shows the number of nodes in each state (S, I, R) over time.
## THINGS TO NOTICE
At the end of the run, after the virus has died out, some nodes are still susceptible, while others have become immune. What is the ratio of the number of immune nodes to the number of susceptible nodes? How is this affected by changing the AVERAGE-NODE-DEGREE of the network?
## THINGS TO TRY
Set GAIN-RESISTANCE-CHANCE to 0%. Under what conditions will the virus still die out? How long does it take? What conditions are required for the virus to live? If the RECOVERY-CHANCE is bigger than 0, even if the VIRUS-SPREAD-CHANCE is high, do you think that if you could run the model forever, the virus could stay alive?
## EXTENDING THE MODEL
The real computer networks on which viruses spread are generally not based on spatial proximity, like the networks found in this model. Real computer networks are more often found to exhibit a "scale-free" link-degree distribution, somewhat similar to networks created using the Preferential Attachment model. Try experimenting with various alternative network structures, and see how the behavior of the virus differs.
Suppose the virus is spreading by emailing itself out to everyone in the computer's address book. Since being in someone's address book is not a symmetric relationship, change this model to use directed links instead of undirected links.
Can you model multiple viruses at the same time? How would they interact? Sometimes if a computer has a piece of malware installed, it is more vulnerable to being infected by more malware.
Try making a model similar to this one, but where the virus has the ability to mutate itself. Such self-modifying viruses are a considerable threat to computer security, since traditional methods of virus signature identification may not work against them. In your model, nodes that become immune may be reinfected if the virus has mutated to become significantly different than the variant that originally infected the node.
## RELATED MODELS
Virus, Disease, Preferential Attachment, Diffusion on a Directed Network
## NETLOGO FEATURES
Links are used for modeling the network. The `layout-spring` primitive is used to position the nodes and links such that the structure of the network is visually clear.
Though it is not used in this model, there exists a network extension for NetLogo that you can download at: https://github.com/NetLogo/NW-Extension.
## HOW TO CITE
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself: