Skip to content

Commit 6fd56a7

Browse files
committed
current-theory-info updating: fix #7 for critical interaction
* Scientists now correctly determine whether a critical-interaction happened * The `evaluate-critically` & the `share` procedure have been adjusted and slightly simplified * The calculation of the scientists posterior after integrating their own pull information has been dropped as doesn’t serve any purpose anymore.
1 parent cd2adac commit 6fd56a7

File tree

1 file changed

+33
-42
lines changed

1 file changed

+33
-42
lines changed

SocNetABM.nlogo

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ to go
5656
ask turtles [
5757
pull
5858
integrate-own-pull-info
59-
if critical-interaction [
60-
calc-posterior
61-
]
6259
]
6360
ask turtles [
6461
share
@@ -229,30 +226,35 @@ end
229226
; the sharing of information between researchers optionally including
230227
; critical-interaction
231228
to share
232-
let cur-turtle self
233-
let successvec 0
234-
let pullcounter 0
229+
let cur-turtle self
230+
let cur-turtle-th mytheory
235231
; first list entry is th1 2nd is th2
236-
let pulls-th1 list pulls 0
237-
let pulls-th2 list 0 pulls
238-
let neighbor-theory 0
232+
let successvec [0 0]
233+
let pullcounter [0 0]
239234
ask link-neighbors [
240-
set successvec successes
241-
ifelse mytheory = 0 [
242-
set neighbor-theory 0
243-
set pullcounter pulls-th1
235+
ifelse mytheory = cur-turtle-th or not critical-interaction [
236+
set successvec (map + successvec successes)
237+
set pullcounter replace-item mytheory pullcounter
238+
(item mytheory pullcounter + pulls)
244239
][
245-
set neighbor-theory 1
246-
set pullcounter pulls-th2
247-
]
248-
ask cur-turtle [
249-
set a (map + a successvec)
250-
set b (map + b pullcounter)
251-
if critical-interaction and mytheory != neighbor-theory [
252-
evaluate-critically
240+
let other-successes successes
241+
let other-theory mytheory
242+
let other-success-ratio ((item mytheory successes) / pulls)
243+
if other-success-ratio > item mytheory [current-theory-info] of
244+
cur-turtle [
245+
ask cur-turtle [
246+
evaluate-critically
247+
]
248+
]
249+
ask cur-turtle [
250+
set a (map + a other-successes)
251+
set b replace-item other-theory b (item other-theory b + pulls)
252+
calc-posterior
253253
]
254254
]
255255
]
256+
set a (map + a successvec)
257+
set b (map + b pullcounter)
256258
end
257259

258260

@@ -262,30 +264,19 @@ end
262264
; If researchers communicate with researchers from another theory they might
263265
; interact critically
264266
to evaluate-critically
265-
let old-theory-info current-theory-info
266-
calc-posterior
267-
let diff-theory-info (map - current-theory-info old-theory-info)
267+
let actual-prob-suc 0
268268
ifelse mytheory = 0 [
269-
if item 0 diff-theory-info < 0 or item 1 diff-theory-info > 0 [
270-
set crit-interactions-th1 crit-interactions-th1 + 1
271-
if crit-interact-lock = 0 [
272-
set crit-interact-lock crit-jump-threshold
273-
]
274-
let old-th-1-signal item 0 subj-th-i-signal
275-
set subj-th-i-signal replace-item 0 subj-th-i-signal (old-th-1-signal
276-
+ (1 - old-th-1-signal) * crit-strength)
277-
]
269+
set crit-interactions-th1 crit-interactions-th1 + 1
270+
set actual-prob-suc 1
278271
][
279-
if item 0 diff-theory-info > 0 or item 1 diff-theory-info < 0 [
280-
if crit-interact-lock = 0 [
281-
set crit-interact-lock crit-jump-threshold
282-
]
283-
set crit-interactions-th2 crit-interactions-th2 + 1
284-
let old-th-2-signal item 1 subj-th-i-signal
285-
set subj-th-i-signal replace-item 1 subj-th-i-signal (old-th-2-signal
286-
+ (0 - old-th-2-signal) * crit-strength)
287-
]
272+
set crit-interactions-th2 crit-interactions-th2 + 1
273+
]
274+
if crit-interact-lock = 0 [
275+
set crit-interact-lock crit-jump-threshold
288276
]
277+
let old-th-i-signal item mytheory subj-th-i-signal
278+
set subj-th-i-signal replace-item mytheory subj-th-i-signal (old-th-i-signal
279+
+ (actual-prob-suc - old-th-i-signal) * crit-strength)
289280
end
290281

291282

0 commit comments

Comments
 (0)