Skip to content

Commit a2f4e23

Browse files
committed
Added sanity-check to setup
* The `sanity-check` procedure makes sure that the values for aps (in case of nature-evidence or critical-interaction) or starting cps (=thx-signal) are reasonable i.e. that theory1 is actually the better theory.
1 parent c0ad2bc commit a2f4e23

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

SocNetABM.nlogo

+19
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ to setup [rs]
1717
clear-all
1818
set rndseed rs
1919
random-seed rs
20+
check-sanity
2021
init-hidden-variables
2122
init-converge-reporters
2223
set th-i-signal list th1-signal th2-signal
@@ -110,6 +111,24 @@ end
110111

111112

112113

114+
; some basic sanity checks, which ensure that the chosen model parameters are
115+
; sensible
116+
to check-sanity
117+
ifelse critical-interaction or nature-evidence-frequency > 0 [
118+
if th1-aps < th2-aps [
119+
error "th1-aps must be higher than th2-aps (th1 is the better theory)"
120+
]
121+
][
122+
if th1-signal < th2-signal [
123+
error "th1-signal must be higher than th2-signal (th1 is the better theory)"
124+
]
125+
]
126+
end
127+
128+
129+
130+
131+
113132
; initializes the hidden variables (= not set in the interface)
114133
to init-hidden-variables
115134
set confidence-cutoff 1 - (1 / 10 ^ 4)

0 commit comments

Comments
 (0)