-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFrantisekProMisuV10.nlogo
1953 lines (1796 loc) · 49.6 KB
/
FrantisekProMisuV10.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
extensions [nw matrix]
breed [consumats consumat]
turtles-own [
attitude ;; actual attitude of consumat
cognition ;; stores code of cognitive process used present round for determining non/sorting
sorting ;; actual sorting behavior of consumat
Nit-1 ;; Needs' satisfaction previous round
Nit ;; Needs' satisfaction recent round
NSik ;; Satisfaction of social needs
NPik ;; Satisfaction of personal needs
Ui ;; Uncertainity
beta ;; Randomly distributed agent parameter determining how much personal needs are weighted versus social ones
record ;; list with recorded values of SORTING since SETUP until the last round
changed? ;; did turtle changed SORTING since the previous round?
loadedAttitude ;; attitude index loaded from file
finalBehavior ;; final behavior index loaded from file
finalSorting ;; final sorting behavior loaded from file
simSorting ;; sorting RECORD rocoded into ordinal variable equivalent to FINALSORTING
diffSorting2 ;; squarred difference between FINALSORTING and SIMSORTING
]
globals [
end? ;; stores TRUE if conditions for finishing simulation are satisfied
globalDiffSorting ;; indicator of quality of model fit to ISSP data
individualDiffSorting ;; secondary indicator of model fit
]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; reporters substituting globals ;;;;
;; sorting: no/yes
to-report no
report 0
end
to-report yes
report 1
end
;; cognitive processes
to-report repetition
report 0
end
to-report imitation
report 1
end
to-report deliberation
report 2
end
to-report comparison
report 3
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Startup and Setup
to startup
ca
setup
end
to setup
;; setup itself
if randomSeed? [random-seed RS]
turtle-setup
check-cutoffs
;; Checking of right setting of CUTOFFs
if cutOff12 < 0.005 [
set globalDiffSorting 10
set individualDiffSorting 10
stop
]
;; reseting
reset-ticks
if randomSeed? [random-seed RS]
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to check-cutoffs
if cutOff23 >= cutOff34 [set cutOff23 (cutOff34 - 0.01)]
if cutOff12 >= cutOff23 [set cutOff12 (cutOff23 - 0.01)]
end
to turtle-setup
;; cleaning environment
ca
set-default-shape turtles "circle"
ask patches [set pcolor white]
;; longer turtle procedures - better to separate code to blocks
network-generation
feeding-turtles-with-data
cleaning-turtle-variables
end
to network-generation
;; Generation of Watts-Strogatz small-world network and loading data in turtles
nw:generate-watts-strogatz turtles links 1841 ifelse-value (differentDegree?) [maxCloseLinks] [closeLinks] randomLinks [ ;; The first part of implementation of switch DIFFERENT-DEGREE?
fd 33 ;; make a big circle
set size 5 ;; be big
set beta precision (random-float 1) 4 ;; set possible variables
set record [] ;; initializing RECORD as a list
set changed? false
]
if differentDegree? [ask n-of (((maxCloseLinks - closeLinks) / maxCloseLinks) * count links) links [die]] ;; The idea of DIFFERENT-DEGREE? is to crate small-world with a lot of links (MAX-CLOSE-LINKS)
end ;; and then randomly cut them to the number according CLOSE-LINKS, so we still receive small-world network, but nodes have different numbers of edges.
to feeding-turtles-with-data
;; Loading data in turtles after creating of small-world network
ifelse ( file-exists? "dataMisa4.txt" ) [
file-close
file-open "dataMisa4.txt" ;; NOTE: DataMisa4.txt are sorted according Attitude,
;; firstly we have prepare the list od IDs in specified order: on even positions upper half, on odd positions lower half
let feedingOrder [] ;; we need empty variable for feeding it by cycle
(foreach (range 0 921) (range 1840 919 -1) [ [a b] ->
set feedingOrder lput a feedingOrder
if b > 920 [set feedingOrder lput b feedingOrder]
])
if not homophily? [ ;; If Homophily? condition is FALSE we have to randomize the order of turtles feeding
set feedingOrder shuffle feedingOrder
]
;; Secondly, feeding itself
foreach feedingOrder [ ;; for every ID we find the turtle with respective WHO,
[ID] -> ask turtle ID [ ;; and ask the turtle to feed herself by the data
set finalBehavior file-read
set loadedAttitude file-read
set finalSorting file-read
]
]
file-close
][error "There is no dataMisa4.txt file in current directory!"]
end
to cleaning-turtle-variables
;; turtle variables
ask turtles [
if finalSorting > 4 or finalSorting < 1 [die] ;; turtles with no data or without chance to sort die
set finalSorting (5 - finalSorting) ;; NOTE: we reverse FINALSORTING here, for better comparability mean of RECORD distribution
set attitude loadedAttitude ;; for code-testing purposes we separate attitude used in simulation and value loaded in turtle from data
set sorting ifelse-value (attitude > random-float 1) [yes] [no] ;; initialization with respect to ATTITUDE
change-colour
]
ask turtles [if count my-links = 0 [create-link-with one-of other turtles show "Link added!"]] ;; Every turtle must be connected
;; For computing level of satisfaction we need finished network and all consumats in the network with set behavior
ask turtles [
set Nit-1 satisfaction ;; use routines for NPi and NSi and SATISFACTION
set Nit satisfaction ;; use routines for NPi and NSi and SATISFACTION
set Ui uncertainity ;; USE ROUTINE uncertainity
set record lput sorting record ;; We record SORTING as the first value on RECORD
]
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SETUP and GO reporters and routines
to-report uncertainity
report sqrt( abs(Nit - Nit-1))
end
to-report satisfaction
set NSik ((count link-neighbors with [sorting = [sorting] of myself]) / (count link-neighbors))
set Nsik normalized (random-normal Nsik sigma)
set NPik (1 - (abs (attitude - sorting)))
let Nik (beta * NSik + (1 - beta) * NPik) ;; NSik and NPik weighted by BETA
let price ((sortingPrice * sorting) + (1 - sorting)) ;; designed that for sorting==no equal to 1, for sorting==yes equal to SortingPrice
set Nik (Nik / price) ;; Nik is weighted by sortingPrice
set Nik (normalized (Nik)) ;; We check the Nik is in the interval <0 ; 1>, in case not, we cut value to the interval
report Nik
end
to-report normalized [x]
if x > 1 [set x 1]
if x < 0 [set x 0]
report precision x 4 ;; NOTE: here we round values to 4 digits
end
to-report longTimeSorting%
report precision (100 * mean ([mean record] of turtles)) 2
end
to change-colour
set color ifelse-value (sorting = yes) [green] [red]
end
to test
repeat 5 [
setup
repeat 120 [go]
]
print "Test passed! "
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to go
;; Checking of right setting of CUTOFFs
if cutOff12 < 0.005 [
set globalDiffSorting 10
set individualDiffSorting 10
stop
]
;; GO routine itself
ask turtles [update-variables]
ask turtles [choose-cognitive-process]
ask turtles [update-behavior]
ask turtles [update-consequences]
if ticks >= 9 [update-globals]
check-end
tick
if end? [
;do-regression
stop
]
end
to update-globals
set globalDiffSorting global-difference-in-sorting
set individualDiffSorting individual-difference-in-sorting
end
to do-regression
let y sort ([simSorting] of turtles)
let x sort ([finalSorting] of turtles)
Print "Regression coeficients - the first element of second list is R2:"
print matrix:regress matrix:from-column-list (list y x)
end
to-report global-difference-in-sorting
let x sort ([simSorting] of turtles)
let y sort ([finalSorting] of turtles)
let z (map [[a b] -> ((a - b) ^ 2)] x y)
report precision (mean z) 6
end
to-report individual-difference-in-sorting
let x ([diffSorting2] of turtles)
report precision (mean x) 6
end
to check-end
;; let's suppose, conditions are satisfied :)
set end? true
;; Checking turtles' changes
ask turtles [
set changed? false
let x (length record) - 2
if length record > 1 and last record != (item x record) [set changed? true]
]
;; Checking length of simulation
if count turtles with [changed?] > 0 [set end? false] ;; we continue in simulation if here is some change
if ticks <= 10 [set end? false] ;; anyway, we continue in simulation for 10 ticks
;if length ([record] of one-of turtles) = steps [set end? true] ;; anyway, we stop simulation at 100 ticks
if ticks >= steps [set end? true] ;; anyway, we stop simulation at STEPS ticks
end
to update-variables
set Nit-1 Nit ;; we copy Nit as past satisfaction
set Nit satisfaction ;; we compute recent satisfaction via reporter SATISFACTION
set Ui uncertainity ;; we compute recent uncertainity via reporter UNCERTAINITY
end
to choose-cognitive-process
;; here we just set value of variable COGNITION according NIT and UI values,
;; behavior itself would be chosen elsewhere
ifelse Nit < tauN [
set cognition ifelse-value (Ui > tauU) ["do-comparison"] ["do-deliberation"]
][set cognition ifelse-value (Ui > tauU) ["do-imitation"] ["do-repetition"]]
end
to update-behavior
;; running right cognitive routine, NOTE! the name of the procedure is already stored in COGNITION, we just have to find a way how run the string
run cognition
;; Randomly reversing of planned behavior
;; Not only reverse behavior, we have also recalculate NIT of reversed behavior, but may be NOT...
ifelse diffReversion? [
if sorting = yes and pReverseSorting > random-float 1 [ ;; Just for start, take it the P-REVERSE-SORTING is only for change from YES to NO, later we might also prepare the other change
set sorting no
if recalculateNit? [set Nit satisfaction] ;; let us try it and experiment with difference in recalculation - now it seems there is no substantial effect of recalculation...
]
if sorting = no and 0.1 > random-float 1 [ ;; Just fr start hard-wired value
set sorting yes
if recalculateNit? [set Nit satisfaction] ;; let us try it and experiment with difference in recalculation - now it seems there is no substantial effect of recalculation...
]
][
if pReverseSorting > random-float 1 [
set sorting (1 - sorting)
if recalculateNit? [set Nit satisfaction] ;; let us try it and experiment with difference in recalculation - now it seems there is no substantial effect of recalculation...
]
]
end
to update-consequences
;; recording behavior
set record lput sorting record ;; We record new SORTING value as the last value on RECORD
if length record > 100 [set record (but-first record)] ;; triming RECORD list to the last 100 records
;; Updating simulated answer to the sorting question
if ticks >= 9 [
let value (mean record)
ifelse value < cutoff23 [
set simSorting ifelse-value (value < cutoff12) [1][2]
][set simSorting ifelse-value (value < cutoff34) [3][4]
]
set diffSorting2 ((simSorting - finalSorting) ^ 2)
]
;; Re-color
change-colour
end
to do-repetition ;; consumat repeats SORTING
;; sorting is set from previous round, so there is no need to do anything :)
;; at least now :)
end
to do-imitation ;; consumat imitates the most common value of SORTING
;; we use MODES function, which returns list of most common values,
;; in case more values are the most frequent it returns list of all the most common values
let mostCommonValues modes [sorting] of link-neighbors
;; from these most common values we choose randomly by function ONE-OF,
;; in case the list contain only one value, ONE-OF turns list of one value into the value
set sorting one-of mostCommonValues
end
to do-deliberation ;; consumat compares NIT valueas for both values of SORTING
;;;; We set SORTING to NO, compute NIT, then we set it to YES, compute again and compare results
;; Computing for NO
set sorting no
let NitNo satisfaction
;; Computing for YES
set sorting yes
let NitYes satisfaction
;; Setting SORTING to better value
ifelse NitNo = NitYes [
set sorting one-of (list no yes) ;; in case of tie we choose randomly
][set sorting ifelse-value (NitYes > NitNo) [yes] [no]] ;; else we choose better value
end
to do-comparison ;; consumat compares SORTING
;;;; Firstly we compute NIT for actual SORTING,
;;;; then secondly for the most common SORTING in the neighborhood,
;;;; lastly we choose the better value.
;; Computing for my SORTING
let myNit Nit ;; SORTING is already set, NIT was already computed, we just store it in new variable for sure
let mySorting sorting ;; we have to store respective SORTING
;; Computing for their SORTING - it would be possible use here DO-IMITATION routine,
;; but for sure, we write it here again
;; (may be in the future versions of DO-IMITATION will not be possible or suitable use this routine).
set sorting one-of modes [sorting] of link-neighbors ;; very condensed version of code used for DO-IMITATION
let theirNit satisfaction ;; we compute NIT for the most common value of SORTING
let theirSorting sorting ;; we have to store respective SORTING
;; Setting SORTING to better value
ifelse theirNit = myNit [
set sorting one-of (list mySorting theirSorting) ;; in case of tie we choose randomly
][set sorting ifelse-value (myNit > theirNit) [mySorting] [theirSorting]] ;; else we choose better value
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@#$#@#$#@
GRAPHICS-WINDOW
210
10
644
445
-1
-1
6.0
1
10
1
1
1
0
0
0
1
-35
35
-35
35
1
1
1
ticks
30.0
BUTTON
18
10
81
43
NIL
setup
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
81
10
144
43
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
0
SLIDER
18
42
207
75
randomLinks
randomLinks
0.00
0.50
0.1
0.001
1
NIL
HORIZONTAL
SLIDER
18
75
207
108
closeLinks
closeLinks
1
15
3.0
1
1
NIL
HORIZONTAL
SLIDER
18
141
207
174
tauN
tauN
0
1
0.35
0.05
1
NIL
HORIZONTAL
SLIDER
18
174
207
207
tauU
tauU
0
1
0.5
0.05
1
NIL
HORIZONTAL
PLOT
656
11
1077
175
Environmental behaviour
NIL
NIL
0.0
10.0
0.0
2000.0
true
true
"" ""
PENS
"red" 1.0 0 -5298144 true "" "plot count turtles with [sorting = no]"
"green" 1.0 0 -12087248 true "" "plot count turtles with [sorting = yes]"
"changed" 1.0 0 -16777216 true "" "plot count turtles with [changed?]"
MONITOR
125
416
207
461
N
count turtles
0
1
11
BUTTON
144
10
207
43
1step
go
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
125
371
207
416
% long links
100 * count links with [link-length > 2] / count links
3
1
11
SLIDER
1076
326
1275
359
sortingPrice
sortingPrice
0.5
2
1.05
0.05
1
NIL
HORIZONTAL
MONITOR
43
371
125
416
changed?
count turtles with [changed?]
17
1
11
PLOT
656
175
861
295
Sorting of agents
NIL
NIL
0.0
1.1
0.0
10.0
true
false
"" "set-plot-y-range 0 10"
PENS
"default" 0.03 1 -16777216 true "" "histogram [mean record] of turtles"
PLOT
861
175
1077
295
Sorting of resps. (REVERSED!)
NIL
NIL
0.5
5.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -16777216 true "" "histogram [finalSorting] of turtles"
PLOT
861
295
1077
445
Behavioral index of respondents
NIL
NIL
0.0
1.1
0.0
10.0
true
false
"" ""
PENS
"default" 0.1 1 -16777216 true "" "histogram [finalBehavior] of turtles"
PLOT
656
295
861
445
Attitudes of respondents
NIL
NIL
0.0
1.1
0.0
10.0
true
false
"" ""
PENS
"default" 0.1 1 -16777216 true "" "histogram [loadedAttitude] of turtles"
SWITCH
1076
294
1275
327
randomSeed?
randomSeed?
1
1
-1000
MONITOR
43
416
125
461
% sorting
100 * mean [sorting] of turtles
1
1
11
PLOT
1076
11
1276
175
Beta of "changed?" agents
NIL
NIL
0.0
1.1
0.0
10.0
true
false
"" "set-plot-y-range 0 10"
PENS
"default" 0.1 1 -16777216 true "" "histogram [beta] of turtles with [changed?]"
SLIDER
18
207
207
240
pReverseSorting
pReverseSorting
0
.2
0.1
0.001
1
NIL
HORIZONTAL
SLIDER
18
240
207
273
sigma
sigma
0
0.6
0.0
0.01
1
NIL
HORIZONTAL
INPUTBOX
1076
358
1130
418
RS
500.0
1
0
Number
INPUTBOX
1129
358
1184
418
steps
115.0
1
0
Number
SLIDER
18
272
207
305
cutoff12
cutoff12
0.005
0.495
0.355
0.01
1
NIL
HORIZONTAL
SLIDER
18
305
207
338
cutoff23
cutoff23
0.105
0.895
0.605
0.01
1
NIL
HORIZONTAL
SLIDER
18
338
207
371
cutoff34
cutoff34
0.505
0.995
0.805
0.01
1
NIL
HORIZONTAL
PLOT
1076
175
1276
295
Sorting of agents (RECODED!)
NIL
NIL
0.5
5.0
0.0
10.0
true
false
"" "set-plot-y-range 0 10"
PENS
"default" 1.0 1 -16777216 true "" "histogram [simSorting] of turtles"
MONITOR
1183
358
1275
403
NIL
globalDiffSorting
17
1
11
MONITOR
1183
402
1275
447
NIL
individualDiffSorting
17
1
11
PLOT
656
445
1077
595
Attitude vs. sim/finalSorting
NIL
NIL
0.5
4.5
0.0
1.0
true
true
"" "clear-plot\n"
PENS
"simSorting" 1.0 2 -16777216 true "" "ask turtles [plotxy simSorting attitude]"
"finalSorting" 1.0 2 -2674135 true "" "ask turtles [plotxy (finalSorting + 0.15) attitude]"
MONITOR
1077
418
1145
463
group4
(word precision (mean [attitude] of turtles with [simSorting = 4]) 2\n\"; \"\nprecision (median [attitude] of turtles with [simSorting = 4]) 2\n)
17
1
11
MONITOR
1077
462
1145
507
group3
(word precision (mean [attitude] of turtles with [simSorting = 3]) 2\n\"; \"\nprecision (median [attitude] of turtles with [simSorting = 3]) 2\n)
17
1
11
MONITOR
1077
506
1145
551
group2
(word precision (mean [attitude] of turtles with [simSorting = 2]) 2\n\"; \"\nprecision (median [attitude] of turtles with [simSorting = 2]) 2\n)
17
1
11
MONITOR
1077
550
1145
595
group1
(word precision (mean [attitude] of turtles with [simSorting = 1]) 2\n\"; \"\nprecision (median [attitude] of turtles with [simSorting = 1]) 2\n)
17
1
11
SWITCH
1144
446
1275
479
recalculateNit?
recalculateNit?
0
1
-1000
SWITCH
1144
478
1275
511
homophily?
homophily?
1
1
-1000
BUTTON
43
505
144
538
check homophily
ask turtles [\n ;bk loadedAttitude * 35\n set color blue - 5 + loadedAttitude * 9.9\n]\n
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
43
460
207
505
% long-time sorting
longTimeSorting%
1
1
11
BUTTON
144
505
207
538
NIL
test
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SWITCH
1144
510
1275
543
differentDegree?
differentDegree?
1
1
-1000
SLIDER
18
108
207
141
maxCloseLinks
maxCloseLinks
1
100
100.0
1
1
NIL
HORIZONTAL
SWITCH
1144
542
1275
575
diffReversion?
diffReversion?
1
1
-1000
PLOT
210