diff --git a/PROTON-OC.nlogo b/PROTON-OC.nlogo
index 80d1841b..cfc862f0 100644
--- a/PROTON-OC.nlogo
+++ b/PROTON-OC.nlogo
@@ -672,8 +672,8 @@ end
to setup-oc-groups
; OC members are scaled down if we don't have 10K agents
- let scaled-num-oc-families ceiling num-oc-families * num-persons / 10000
- let scaled-num-oc-persons ceiling num-oc-persons * num-persons / 10000
+ let scaled-num-oc-families ceiling (num-oc-families * num-persons / 10000 * num-oc-persons / 30)
+ let scaled-num-oc-persons ceiling (num-oc-persons * num-persons / 10000)
ask rnd:weighted-n-of scaled-num-oc-families persons [
criminal-tendency + criminal-tendency-addme-for-weighted-extraction
] [
@@ -1209,6 +1209,7 @@ end
to commit-crimes
let co-offender-groups []
+ let co-offenders-started-by-OC []
foreach table:keys c-range-by-age-and-sex [ cell ->
let value last table:get c-range-by-age-and-sex cell
let people-in-cell persons with [
@@ -1220,6 +1221,7 @@ to commit-crimes
ask rnd:weighted-one-of people-in-cell [ criminal-tendency + criminal-tendency-addme-for-weighted-extraction ] [
let accomplices find-accomplices number-of-accomplices
set co-offender-groups lput (turtle-set self accomplices) co-offender-groups
+ if oc-member? [ set co-offenders-started-by-OC lput (turtle-set self accomplices) co-offenders-started-by-OC ]
; check for big crimes started from a normal guy
if length accomplices + 1 > this-is-a-big-crime and criminal-tendency < good-guy-threshold [
set big-crime-from-small-fish big-crime-from-small-fish + 1
@@ -1234,10 +1236,7 @@ to commit-crimes
if not empty? co-offender-groups [
set co-offender-group-histo make-co-offending-histo co-offender-groups
]
- let oc-co-offender-groups filter [ co-offenders ->
- any? co-offenders with [ oc-member? ]
- ] co-offender-groups
- foreach oc-co-offender-groups [ co-offenders ->
+ foreach co-offenders-started-by-OC [ co-offenders ->
ask co-offenders with [ not oc-member? ] [
set new-recruit ticks
set oc-member? true
@@ -1287,6 +1286,7 @@ to retire-persons
end
to-report find-accomplices [ n ] ; person reporter
+ if n = 0 [ report [ ] ]
let d 1 ; start with a network distance of 1
let accomplices []
nw:with-context persons person-links [
@@ -1343,8 +1343,11 @@ end
; this is what in the paper is called r - this is r
;R is then operationalised as the proportion of OC members among the social relations of each individual (comprising family, friendship, school, working and co-offending relations)
to-report candidate-weight ; person reporter
- let r ifelse-value [ oc-member? ] of myself [ oc-embeddedness ] [ 0 ]
- report -1 * (social-proximity-with myself + r)
+ report -1 * ifelse-value [ oc-member? ] of myself [
+ (social-proximity-with myself * oc-embeddedness * criminal-tendency)
+ ] [
+ (social-proximity-with myself * criminal-tendency)
+ ]
end
to calculate-criminal-tendency
@@ -2142,7 +2145,7 @@ num-oc-persons
num-oc-persons
2
200
-20.0
+30.0
1
1
NIL
@@ -2193,7 +2196,7 @@ CHOOSER
family-intervention
family-intervention
"none" "remove-if-caught" "remove-if-OC-member" "remove-if-caught-and-OC-member"
-3
+0
CHOOSER
15
diff --git a/experiments-xml/xml-launch/xml-launch-OC.xml b/experiments-xml/xml-launch/xml-launch-OC.xml
new file mode 100644
index 00000000..ae630238
--- /dev/null
+++ b/experiments-xml/xml-launch/xml-launch-OC.xml
@@ -0,0 +1,189 @@
+
+
+
+
+ setup
+ go
+ show (word "Time elapsed:" timer)
+ dump-networks
+
+
+
+
+ o1
+
+ o2
+
+ o3
+
+ o4
+
+ o5
+ o5a
+
+ o6
+ o6a
+
+ o7a
+ o7b
+ o7c
+
+ o8a
+ o8b
+ o8c
+
+ o9a
+ o9b
+ o9c
+
+ o10a
+ o10b
+ o10c
+
+ o11
+
+ o12
+
+ o13
+
+ o14
+
+ o15
+
+ o16
+ count persons
+ count links
+ count prisoners
+ count persons with [ migrant? ]
+ number-deceased
+ sum [ num-crimes-committed ] of persons
+ count persons with [ my-job != nobody ]
+ count jobs with [ my-worker != nobody ]
+ crime-size-fails
+ count persons with [facilitator?]
+ facilitator-fails
+ facilitator-crimes
+ count household-links
+ count partner-links
+ count sibling-links
+ count offspring-links
+ count friendship-links
+ count criminal-links
+ count professional-links
+ count school-links
+ count meta-links
+ sum [ count my-students ] of schools
+ count jobs
+ count all-persons with [ num-crimes-committed = 0 ]
+ count all-persons with [ my-job = nobody and my-school = nobody and age > 16 and age < 65 ] / count all-persons with [my-job = nobody and my-school = nobody and age > 16 and age < 65 ]
+ people-jailed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/experiments-xml/xml-launch/xml-test-OC.xml b/experiments-xml/xml-launch/xml-test-OC.xml
new file mode 100644
index 00000000..5ba55156
--- /dev/null
+++ b/experiments-xml/xml-launch/xml-test-OC.xml
@@ -0,0 +1,178 @@
+
+
+
+
+ setup
+ go
+ show (word "Time elapsed:" timer)
+ dump-networks
+
+
+
+
+ o1
+
+ o2
+
+ o3
+
+ o4
+
+ o5
+ o5a
+
+ o6
+ o6a
+
+ o7a
+ o7b
+ o7c
+
+ o8a
+ o8b
+ o8c
+
+ o9a
+ o9b
+ o9c
+
+ o10a
+ o10b
+ o10c
+
+ o11
+
+ o12
+
+ o13
+
+ o14
+
+ o15
+
+ o16
+ count persons
+ count links
+ count prisoners
+ count persons with [ migrant? ]
+ number-deceased
+ sum [ num-crimes-committed ] of persons
+ count persons with [ my-job != nobody ]
+ count jobs with [ my-worker != nobody ]
+ crime-size-fails
+ count persons with [facilitator?]
+ facilitator-fails
+ facilitator-crimes
+ count household-links
+ count partner-links
+ count sibling-links
+ count offspring-links
+ count friendship-links
+ count criminal-links
+ count professional-links
+ count school-links
+ count meta-links
+ sum [ count my-students ] of schools
+ count jobs
+ count all-persons with [ num-crimes-committed = 0 ]
+ count all-persons with [ my-job = nobody and my-school = nobody and age > 16 and age < 65 ] / count all-persons with [my-job = nobody and my-school = nobody and age > 16 and age < 65 ]
+ people-jailed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nls_files/experiments.nls b/nls_files/experiments.nls
index e3a614eb..64070c33 100644
--- a/nls_files/experiments.nls
+++ b/nls_files/experiments.nls
@@ -20,17 +20,17 @@ end
to-report o5
; Distribution of C (which is the individual propensity towards crime commission)
- report make-histo [ -> criminal-tendency ] 7 -2 2
+ report make-histo [ -> criminal-tendency ] 7 -2 3 all-persons
end
-to-report make-histo [ citizen-reporter bins min-v max-v ]
- let values [ runresult citizen-reporter ] of all-persons
+to-report make-histo [ citizen-reporter bins min-v max-v the-set ]
+ let values [ runresult citizen-reporter ] of the-set
let counts n-values bins [ 0 ]
assert [ -> min-v < max-v ]
let thresholds (sentence (range min-v max-v ((max-v - min-v) / bins)) max-v)
let i 0
foreach values [ v ->
- ifelse (v < first thresholds or v > last thresholds) [
+ ifelse (v < min-v or v > max-v) [
show (word behaviorspace-run-number ": histogram for " citizen-reporter " has values outside of coverage (" v ")")
] [
set i 0
@@ -45,7 +45,11 @@ to-report make-discrete-histo [ citizen-reporter low high ]
let values table:to-list table:counts runresult citizen-reporter
let counts n-values (high - low + 1) [ i -> list (i + low) 0 ]
foreach values [ v ->
- set counts replace-item ((first v) - low) counts (list first v last v)
+ ifelse (first v < low or first v > high) [
+ show (word behaviorspace-run-number ": histogram for " citizen-reporter " has values outside of coverage (" v ")")
+ ] [
+ set counts replace-item ((first v) - low) counts (list first v last v)
+ ]
]
report counts
end
@@ -57,12 +61,12 @@ end
to-report o6
; Distribution of R (which is the individual embededdness into OC-prone local networks)
- report make-histo [ -> oc-embeddedness ] 7 0 1
+ report make-histo [ -> oc-embeddedness ] 7 0 1 all-persons with [ oc-member? ]
end
to-report o6a
; average of R (which is the individual embededdness into OC-prone local networks)
- report mean [ oc-embeddedness ] of all-persons
+ report mean [ oc-embeddedness ] of all-persons with [ oc-member? ]
end
to-report o7a
@@ -113,7 +117,7 @@ end
to-report o10a
; Distribution of socio-demographic variables of the general population
- report make-discrete-histo [ -> [ education-level ] of all-persons ] -1 4
+ report make-discrete-histo [ -> [ education-level ] of all-persons ] 0 4
end
to-report o10b
@@ -123,7 +127,7 @@ end
to-report o10c
; Distribution of socio-demographic variables of the general population
- report make-discrete-histo [ -> [ job-level ] of all-persons ] 1 4
+ report make-discrete-histo [ -> [ job-level ] of all-persons ] 0 4
end
to-report o11