extensions [ time ] breed [ villages village ] breed [ shops shop ] breed [ extorters extorter ] breed [ police police-officer ] breed [ public consumer ] globals [ ;; global input parameters not manipulated via the interface sensitivity-batch? bgmin bgmax intervention-batch? special-batch? is-batch? run-group max-shop-distance max-customers state-punishment-factor collaboration-probability WC WO WNPV WP WS WE ;; weights for salience calculation IDW ;; weights for calculating action probability from ;; individual drive and normative drive; IDW = 1 - NDW ;; macro variable which can be accessed by police criminal-records ;; macro output variables confiscated total-money shopping-amount max-family-depth this-family-depth size-of-largest-family time-when-addio-pizzo-takes-over m-ass-a-p-shops m-ass-non-a-p m-ass-ext-act m-ass-ext-jail m-ass-ext-inact min-sal max-sal n-sal ;; variables for bookkeeping startdate real-startdate stopdate no-extortion-after event-counter length-moving-average n-extortions n-of-undetected-cases n-of-detected-cases n-of-denounced-extortions n-of-prosecuted-cases n-of-successful-extortions n-of-successful-detected-extortions n-of-cases-with-punishment n-of-cases-with-arrest n-of-cases-with-conviction percentage-of-undetected-cases percentage-of-unreported-cases percentage-of-denounced-extortions percentage-of-completed-extortions percentage-of-cases-with-arrest percentage-of-cases-with-punishment percentage-of-cases-with-conviction denunciation-rate prosecution-rate success-rate arrest-rate conviction-rate percentage-of-critical-consumers mean-shop-wealth-addio-pizzo mean-shop-wealth-non-addio-pizzo n-families n-shops-non-addio-pizzo n-shops-addio-pizzo n-shops-still-paying count-addio-pizzo-shopping count-non-addio-pizzo-shopping addio-pizzo-shopping-percentage time-of-last-completed-extortion current-seed run-type ;; global variables only used to signal events of quantities between procedures extortion-database ;; this a list of lists containing 11 items: with the following keys to list items: i-extorter i-victim i-first-attempt i-denounced-at i-paid-at i-prosecution-start i-amount-paid i-punished-at i-punishment-amount i-arrested-at i-convicted-at i-sentence NULL ;; global variables kept only for technical purposes world-too-small? ERROR-OCCURRED? message-id interface-filename logfile-name database-name history-name ;; means and standard deviations of norm saliences all-norms all-norm-types all-means all-sds ] ;; the event board common to all agent types (except villages) turtles-own [ last-message-id my-norms my-norm-saliences my-compliances my-violations other-compliances other-violations punishments sanctions explicit-compliance-invocations explicit-violations individual-drive normative-drive ] shops-own [ shop-wealth old-wealth monthly-income volume-of-sales-this-month volume-of-loss-this-month addio-pizzo? bankrupt? current-customers potential-extorter date-of-recent-punishment amount-of-recent-punishment my-denunciation-propensity my-pay-extortion-propensity ] extorters-own [ extortion-radius extortion-level punishment-severity extorter-type extortion-now wealth forbidden-shops state was-in-jail? my-ruefulness my-family role n-of-family-members ] public-own [ my-current-shop distance-to-my-current-shop private-wealth consumption-rate my-addio-pizzo-buy-propensity ] police-own [ my-prosecution-propensity ] patches-own [ ] directed-link-breed [ reports-to-links reports-to-link ] directed-link-breed [ levies-tribute-from-links levies-tribute-from-link ] directed-link-breed [ pay-links pay-link ] directed-link-breed [ threaten-links threaten-link ] pay-links-own [ ] threaten-links-own [ extortion-start ;; variables contain time in ticks extortion-end extortion-completed ;; if this one and the following never happen, their value remains -1 extortion-denounced extortion-accused extortion-convicted ] ;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Startup Procedure ;; ;;;;;;;;;;;;;;;;;;;;;;; to startup set sensitivity-batch? false set intervention-batch? false set special-batch? false set is-batch? false set bgmin (-80) set bgmax 50 set intervention-month 0 set intervention-type 0 set shop-reset false set public-reset false set extorter-reset false set police-reset false end ;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Setup Procedures ;; ;;;;;;;;;;;;;;;;;;;;;;; to setup ;; (for this model to work with NetLogo's new plotting features, ;; __clear-all-and-reset-ticks should be replaced with clear-all at ;; the beginning of your setup procedure and reset-ticks at the end ;; of the procedure.) clear-all clear-output set startdate time:create "1980/01/01 00:00" reset-ticks set event-counter 0 set no-extortion-after T TNOW ;; set saliences-and-propensities [] set message-id 0 set world-too-small? false let initial-agents initial-shops + initial-public + initial-police + initial-extorters + initial-villages if initial-agents > world-width * world-height [ let new-size ceiling sqrt initial-agents let new-patchsize patch-size * ( world-width / new-size ) output-show ( word "The world is too small for " initial-agents " agents." ) output-show "Edit the view, keep in mind that " output-show "if you enlarge the world, " output-show "you should adapt the patch-size." output-show "Set max-pxcor and max-pycor to" output-show ( word ( new-size - 1 ) " and patch-size to" ) output-show new-patchsize set world-too-small? true stop ] set extortion-database ( list ( list "extorter" "victim" "attempt-planned" "denounced_at" "paid_at" "prosecution_start" "amount_paid" "punished_at" "punishment_amount" "arrested_at" "convicted_at" "years_in_jail" ) ) set i-extorter 0 set i-victim 1 set i-first-attempt 2 set i-denounced-at 3 set i-paid-at 4 set i-prosecution-start 5 set i-amount-paid 6 set i-punished-at 7 set i-punishment-amount 8 set i-arrested-at 9 set i-convicted-at 10 set i-sentence 11 set NULL "" set all-norms ( list "DO-NOT-SHOP-AT-EXTORTION-PAYER" "BUY-FROM-EXTORTION-PAYER" "DENOUNCE-EXTORTION" "DO-NOT-DENOUNCE" "ANXIETY-IS-JUSTIFIED" "TRY-HARD-TO-IMPRISON" "DO-NOT-PAY-EXTORTION" "PAY-EXTORTION-AS-EVERYBODY-DOES" "DO-NOT-BETRAY-COLLEAGUES" "ABJURE-CRIME" ) set all-norm-types ( list "LIBERAL" "TRADITIONAL" "LIBERAL" "TRADITIONAL" "TRADITIONAL" "LIBERAL" "LIBERAL" "TRADITIONAL" "TRADITIONAL" "LIBERAL" ) set all-means n-values length all-norms [ 0 ] set all-sds all-means set max-sal (-1) set min-sal (2) let run-identifier ( word "000" behaviorspace-run-number ) set real-startdate date-and-time set run-identifier substring ( run-identifier ) ( length ( run-identifier ) - 4 ) length ( run-identifier ) set interface-filename ( word "result_" run-identifier "_" rectify-date ".png" ) set logfile-name ( word "logfile_" run-identifier "_" rectify-date ".txt" ) set database-name ( word "database_" run-identifier "_" rectify-date ".csv" ) set history-name ( word "history_" run-identifier "_" rectify-date ".csv" ) set csv-separator ";" ifelse file-exists? history-name [ file-open history-name ] [ file-open history-name file-type "behaviorspace_run_number" file-type csv-separator file-type "run_type" file-type csv-separator file-type "run_group" file-type csv-separator file-type "intervention_type" file-type csv-separator file-type "ticks" file-type csv-separator file-type "current_seed" file-type csv-separator file-type "real_time" file-type csv-separator file-type "real_time_since" file-type csv-separator file-type "background" file-type csv-separator file-type "norm_weight" file-type csv-separator file-type "locality" file-type csv-separator file-type "discount_rate" file-type csv-separator file-type "percentage_of_undetected_cases" file-type csv-separator file-type "percentage_of_unreported_cases" file-type csv-separator file-type "percentage_of_denounced_extortions" file-type csv-separator file-type "percentage_of_completed_extortions" file-type csv-separator file-type "percentage_of_cases_with_arrest" file-type csv-separator file-type "percentage_of_cases_with_punishment" file-type csv-separator file-type "denunciation_rate" file-type csv-separator file-type "prosecution_rate" file-type csv-separator file-type "success_rate" file-type csv-separator file-type "arrest_rate" file-type csv-separator file-type "conviction_rate" file-type csv-separator file-print "percentage_of_critical_consumers" ] file-close set time-when-addio-pizzo-takes-over -1 set ERROR-OCCURRED? false set total-money 0 ;; these are only for the norm-version, initialisation for searching the parameter space of this model are planned but not yet implemented set WC 0.99 set WO 0.33 set WNPV 0.66 set WP 0.33 set WS 0.99 set WE 0.99 ;; these are the standard settings for the parameters which can be controlled with the sliders set initial-shops 100 set initial-wealth-min 60000 set initial-wealth-max 60000 set fixed-cost-per-period 200 set variable-cost-coefficient 0.7 set hide-denounce-propensity 0.1 ;; 0.05 set initial-extorters 50 set initial-extortion-radius 5 set extortion-radius-extension 1.05 set extortion-level-low 10 set extortion-level-high 10 set punishment-severity-low 30 set punishment-severity-high 30 set solidarity 0.5 set propensity-to-offend-addio-pizzo 0 set escape-chance 0.35 ;; 0.7 set benefit-for-victims 125 ;; 140 set initial-police 10 set vision-range 8 set conviction-probability 0.05 ;; 0.3 set initial-public 800 set initial-wealth 500 set consumption-rate-low 0.9 set consumption-rate-high 1.0 set initial-villages 30 set LOCAL 5.75 ;; 8 set BACKGROUND (-11.7) ;; (-40) set DISCOUNT 0.95 set NDW 0.673 ;; 0.65 set IDW 1 - NDW set constant-random-seed? false set log-level (-5) set show-extortion-links? true set export-interface? false set max-months 24 set csv-separator ";" set intervention-month 0 set intervention-type 0 set shop-reset false set police-reset false set public-reset false set extorter-reset false ifelse behaviorspace-run-number = 0 [ util-standard-settings set is-batch? false ] [ util-batch-settings set is-batch? true populate ] tick end to populate set stopdate time:plus startdate max-months "months" ;; this serves to search the parameter space of this version if sensitivity-batch? [ set constant-random-seed? false set current-seed new-seed random-seed current-seed ;; the following input parameters are initialised randomly for subsequent runs: set NDW random-float-in-range 0.3 0.7 set IDW 1 - NDW set DISCOUNT random-float-in-range 0.8 1.0 set LOCAL random-float-in-range 2 10 set BACKGROUND random-float-in-range bgmin bgmax set benefit-for-victims random-float-in-range 75 150 set conviction-probability random-float-in-range 0.1 0.8 set extortion-level-low random-float-in-range 10 extortion-level-high set punishment-severity-low random-float-in-range 10 punishment-severity-high ;; set solidarity random-float-in-range 0.1 0.8 ;; set consumption-per-period random-float-in-range 20 420 set escape-chance random-float-in-range 0.1 0.8 set extortion-radius-extension random-float-in-range 1.0 1.2 set vision-range random-float-in-range 2 85 set hide-denounce-propensity random-float-in-range 0 0.125 ] ;; If set to ON, the random seed has the same value in every run. Here it is set to 4711. if constant-random-seed? [ set current-seed 4711 random-seed current-seed ] ;; intervention-type 0: no intervention, 1..4 intervention wrt one breed, 5..10 intervention wrt two breeds, 11..14 intervention wrt three breeds, 15.. intervention wrt all breeds ifelse intervention-batch? [ set run-group floor ( ( behaviorspace-run-number - 1 ) / 16 ) set current-seed 2079913912 + run-group * 7 - 1023 random-seed current-seed set log-level (-3) set extortion-level-low 10 set solidarity 0.5 set consumption-per-period 120 set NDW 0.5227 set IDW 1 - NDW set DISCOUNT 0.907 set LOCAL 2.95 set BACKGROUND (-7.25) set benefit-for-victims 119 set conviction-probability 0.561 set vision-range 37 set punishment-severity-low 22 set hide-denounce-propensity 0.061 set escape-chance 0.270 set extortion-radius-extension 1.056 set intervention-type behaviorspace-run-number mod 16 set extortion-level-low 10 set solidarity 0.5 set consumption-per-period 120 ] [ util-intervention ] if special-batch? [ set run-type behaviorspace-run-number mod 2 set constant-random-seed? false set current-seed new-seed random-seed current-seed ifelse run-type = 0 [ set log-level 6 set NDW 0.4925 set DISCOUNT 0.831 set LOCAL 5.94 set BACKGROUND (-13.2) set benefit-for-victims 80 set conviction-probability 0.331 set vision-range 51 set punishment-severity-low 28 set hide-denounce-propensity 0.074 set escape-chance 0.144 set extortion-radius-extension 1.043 ] [ set log-level 0 set NDW 0.5227 set DISCOUNT 0.907 set LOCAL 2.95 set BACKGROUND (-7.25) set benefit-for-victims 119 set conviction-probability 0.561 set vision-range 37 set punishment-severity-low 22 set hide-denounce-propensity 0.061 set escape-chance 0.270 set extortion-radius-extension 1.056 ] set run-type 99 if run-type = 99 [ set log-level (-5) set NDW 0.525 set DISCOUNT 0.88 set LOCAL 4.7 set BACKGROUND (-12) set benefit-for-victims 126.5 set conviction-probability 0.61 set vision-range 51 set punishment-severity-low 25 set hide-denounce-propensity 0.0705 set escape-chance 0.40777 set extortion-radius-extension 1.093 ] set IDW 1 - NDW set extortion-level-low 10 set solidarity 0.5 set consumption-per-period 120 ] set count-addio-pizzo-shopping 0 set count-non-addio-pizzo-shopping 0 create-villages initial-villages [ villages-setup ] setup-patches create-police initial-police [ police-setup ] create-shops initial-shops [ shops-setup ] set m-ass-non-a-p mean [ shop-wealth ] of shops set mean-shop-wealth-non-addio-pizzo mean [ shop-wealth ] of shops with [ not addio-pizzo? and not bankrupt? ] create-extorters initial-extorters [ extorters-setup ] set m-ass-ext-act mean [ wealth ] of extorters create-public initial-public [ public-setup ] set-normative-predispositions set confiscated 0 set shopping-amount initial-wealth set max-customers 2 * initial-public / initial-shops set state-punishment-factor 1.5 set collaboration-probability 0.5 let headline ( list "case-no" "time" "victim" "extorter" "denounced" "successful" "amount-paid" "punishment" "arrested" "convicted") set criminal-records turtle-set nobody set percentage-of-critical-consumers arctan BACKGROUND end ;; setup procedures for the different agent types follow to villages-setup set color one-of [ 13 23 33 43 33 63 76 83 93 103 113 123 133 ] set shape "church" set size 3 move-to one-of patches with [ not any? other turtles-here ] end to public-setup set color white set shape "person" set size 0.5 move-to one-of patches with [ not any? other turtles-here ] set my-current-shop min-one-of shops [ distance myself ] set private-wealth initial-wealth set consumption-rate random-float-in-range consumption-rate-low consumption-rate-high set last-message-id 0 set my-norms ( list "DO-NOT-SHOP-AT-EXTORTION-PAYER" "BUY-FROM-EXTORTION-PAYER") set my-norm-saliences n-values length my-norms [ 0.0 ] set my-compliances n-values length my-norms [ 0 ] set my-violations n-values length my-norms [ 0 ] set other-compliances n-values length my-norms [ 0 ] set other-violations n-values length my-norms [ 0 ] set punishments n-values length my-norms [ 0 ] set sanctions n-values length my-norms [ 0 ] set explicit-compliance-invocations n-values length my-norms [ 0 ] set explicit-violations n-values length my-norms [ 0 ] end to police-setup set color green set shape "police" move-to one-of villages move-to one-of patches in-radius 2 with [not any? other turtles-here] set last-message-id 0 set my-norms ( list "ANXIETY-IS-JUSTIFIED" "TRY-HARD-TO-IMPRISON" ) set my-norm-saliences n-values length my-norms [ 0.0 ] set my-compliances n-values length my-norms [ 0 ] set my-violations n-values length my-norms [ 0 ] set other-compliances n-values length my-norms [ 0 ] set other-violations n-values length my-norms [ 0 ] set punishments n-values length my-norms [ 0 ] set sanctions n-values length my-norms [ 0 ] set explicit-compliance-invocations n-values length my-norms [ 0 ] set explicit-violations n-values length my-norms [ 0 ] end to shops-setup ;; shops procedure set color blue set shape "house" move-to one-of villages move-to one-of patches in-radius ( world-width / sqrt count villages ) with [ not any? other turtles-here ] set addio-pizzo? false set bankrupt? false set shop-wealth random-float-in-range initial-wealth-min initial-wealth-max set monthly-income shop-wealth / 12 set volume-of-sales-this-month 0 set volume-of-loss-this-month 0 set old-wealth shop-wealth util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW ) set last-message-id 0 set my-norms ( list "DENOUNCE-EXTORTION" "DO-NOT-DENOUNCE" "DO-NOT-PAY-EXTORTION" "PAY-EXTORTION-AS-EVERYBODY-DOES" ) set my-norm-saliences n-values length my-norms [ 0.0 ] set my-compliances n-values length my-norms [ 0 ] set my-violations n-values length my-norms [ 0 ] set other-compliances n-values length my-norms [ 0 ] set other-violations n-values length my-norms [ 0 ] set punishments n-values length my-norms [ 0 ] set sanctions n-values length my-norms [ 0 ] set explicit-compliance-invocations n-values length my-norms [ 0 ] set explicit-violations n-values length my-norms [ 0 ] end to extorters-setup set extortion-radius initial-extortion-radius set extorter-type "LL" set extortion-level extortion-level-low ask patches in-radius extortion-radius [ if ( pcolor mod 10 ) = 6 [ set pcolor pcolor + 1 ] ] if ( random-float 1.0 > 0.5 ) [ set extortion-level extortion-level-high set extorter-type replace-item 0 extorter-type "H" ] set extortion-now extortion-level set punishment-severity punishment-severity-low if ( random-float 1.0 > 0.5 ) [ set punishment-severity punishment-severity-high set extorter-type replace-item 1 extorter-type "H" ] set shape "person" set wealth 2000 set forbidden-shops turtle-set nobody set my-family who set role "*" set state "active" set was-in-jail? false color-extorter move-to one-of villages move-to one-of patches in-radius 3 with [ not any? other turtles-here ] set last-message-id 0 set my-norms ( list "DO-NOT-BETRAY-COLLEAGUES" "ABJURE-CRIME") set my-norm-saliences n-values length my-norms [ 0.0 ] set my-compliances n-values length my-norms [ 0 ] set my-violations n-values length my-norms [ 0 ] set other-compliances n-values length my-norms [ 0 ] set other-violations n-values length my-norms [ 0 ] set punishments n-values length my-norms [ 0 ] set sanctions n-values length my-norms [ 0 ] set explicit-compliance-invocations n-values length my-norms [ 0 ] set explicit-violations n-values length my-norms [ 0 ] set my-ruefulness 0 end to color-extorter set color 45 if extorter-type = "LH" [ set color 25 ] if extorter-type = "HL" [ set color 15 ] if extorter-type = "HH" [ set color 125 ] if state = "pentito" [ set color black set shape "bird" ] end to set-normative-predispositions let LNP BACKGROUND let TNP 10 ifelse LNP < 0 [ set LNP 0 set TNP 0 - BACKGROUND ] [ set TNP 0 ] ask ( turtle-set public shops extorters police ) [ let my-norm-compliance-dispositions [] let my-norm-violation-dispositions [] foreach my-norms [ let np position ? all-norms if item np all-norm-types = "LIBERAL" [ set my-norm-compliance-dispositions lput LNP my-norm-compliance-dispositions set my-norm-violation-dispositions lput TNP my-norm-violation-dispositions ] if item np all-norm-types = "TRADITIONAL" [ set my-norm-compliance-dispositions lput TNP my-norm-compliance-dispositions set my-norm-violation-dispositions lput LNP my-norm-violation-dispositions ] ] set my-compliances my-norm-compliance-dispositions set my-violations my-norm-violation-dispositions set other-compliances my-norm-compliance-dispositions set other-violations my-norm-violation-dispositions set punishments my-norm-violation-dispositions set sanctions my-norm-violation-dispositions set explicit-compliance-invocations my-norm-compliance-dispositions set explicit-violations my-norm-violation-dispositions ] end to reset-normative-dispositions [ this-breed ] let LNP 100 let TNP 0 let test true let reporter one-of this-breed if test [ ask reporter [ util-flog 0 ( word "intervention-type " intervention-type " will reset memories for " self " at " T TNOW ) util-flog 0 my-compliances util-flog 0 my-violations util-flog 0 other-compliances util-flog 0 other-violations util-flog 0 punishments util-flog 0 sanctions util-flog 0 explicit-compliance-invocations util-flog 0 explicit-violations util-flog 0 "-----------------------" ] ] ask ( this-breed ) [ let my-norm-compliance-dispositions [] let my-norm-violation-dispositions [] foreach my-norms [ let np position ? all-norms if item np all-norm-types = "LIBERAL" [ set my-norm-compliance-dispositions lput LNP my-norm-compliance-dispositions set my-norm-violation-dispositions lput TNP my-norm-violation-dispositions ] if item np all-norm-types = "TRADITIONAL" [ set my-norm-compliance-dispositions lput TNP my-norm-compliance-dispositions set my-norm-violation-dispositions lput LNP my-norm-violation-dispositions ] ] set my-compliances my-norm-compliance-dispositions set my-violations my-norm-violation-dispositions set other-compliances my-norm-compliance-dispositions set other-violations my-norm-violation-dispositions set punishments my-norm-violation-dispositions set sanctions my-norm-violation-dispositions set explicit-compliance-invocations my-norm-compliance-dispositions set explicit-violations my-norm-violation-dispositions ] if test [ ask reporter [ util-flog 0 ( word "intervention-type " intervention-type " has reset memories for " self " at " T TNOW ) util-flog 0 my-compliances util-flog 0 my-violations util-flog 0 other-compliances util-flog 0 other-violations util-flog 0 punishments util-flog 0 sanctions util-flog 0 explicit-compliance-invocations util-flog 0 explicit-violations util-flog 0 "-----------------------" ] ] end to reset-public reset-normative-dispositions public end to reset-shops reset-normative-dispositions shops end to reset-police reset-normative-dispositions police end to reset-mafia reset-normative-dispositions extorters end to do-intervention [ it ] if it = 1 or it = 5 or it = 6 or it = 7 or it = 11 or it = 12 or it = 13 or it = 15 [ reset-public ] if it = 2 or it = 5 or it = 8 or it = 9 or it = 11 or it = 13 or it = 14 or it = 15 [ reset-shops ] if it = 3 or it = 6 or it = 8 or it = 10 or it = 11 or it = 12 or it = 14 or it = 15 [ reset-police ] if it = 4 or it = 7 or it = 9 or it = 10 or it = 12 or it = 13 or it = 14 or it = 15 [ reset-mafia ] util-flog (-3) ( word "intervention " it " performed" ) end to setup-patches ask patches [ let nearest-village min-one-of villages [ distance myself ] set pcolor 3 + [ color ] of nearest-village ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Runtime Procedures ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; to go-eventwise if world-too-small? [ stop ] time:clear-schedule time:anchor-schedule startdate 1 "hour" time-schedule-event "observer" task monthly-update "monthly-update" ( time:plus startdate 9 "hours" ) if intervention-month > 0 [ time-schedule-event "observer" task [ do-intervention intervention-type ] "do-intervention intervention-type" ( time:plus startdate intervention-month "months" ) ] time-schedule-event "observer" task send-shopping "send-shopping" ( time:plus startdate 10 "hours" ) ;; show time:show-schedule util-flog 5 ( word "after initialising shops and consumers at " T TNOW " the calendar length is " time:size-of-schedule ) ask extorters [ time-schedule-event self task become-active "become-active" ( time:plus startdate ( random-float-in-range 72 120 ) "hours" ) ] util-flog 5 ( word "after extorters scheduled at " T TNOW " the calendar length is " time:size-of-schedule ) time-schedule-event "observer" task [ report-hierarchies prepare-output update-plots ] "report-hierarchies prepare-output update-plots" ( time:plus startdate 1 "day" ) time-schedule-event "observer" task monthly-payments "monthly-payments" ( time:plus startdate 1 "month" ) util-flog 5 ( word "after monthly payments at " T TNOW " the calendar length is " time:size-of-schedule ) time:schedule-event "observer" task prepare-final-output stopdate set event-counter event-counter + 1 if time:size-of-schedule > 0 [ time:go-until stopdate ] end to time-schedule-event [ executor a-task a-task-name a-time ] set event-counter event-counter + 1 if time:is-equal a-time TNOW [ stop ] if time:is-between a-time startdate TNOW [ stop ] ifelse time:is-between a-time TNOW stopdate [ time:schedule-event executor a-task a-time util-flog 2 ( word "; " executor "; " a-task-name "; " a-task "; " T a-time ) ] [ ;; show ( word a-time " not scheduled between " TNOW " and " stopdate ) stop ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES REGULATING PERIODIC PAYMENTS ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to monthly-update ask shops [ set-shop-variables-for-next-period ] util-flog 5 ( word "A NEW MONTH BEGINS " T TNOW ) util-flog 5 ( list T TNOW " extorters: " sum [ wealth ] of extorters ", shops: " sum [ shop-wealth ] of shops ", confiscated: " confiscated ", bank: " total-money ", in private pockets: " sum [ private-wealth ] of public ) time-schedule-event "observer" task monthly-update "monthly-update" ( time:plus TNOW 1 " month" ) util-flog 5 ( word "after monthly update at " T TNOW " the calendar length is " time:size-of-schedule ) end to send-shopping ask public [ go-shopping ] time-schedule-event "observer" task send-shopping "send-shopping" ( time:plus TNOW 1 "week" ) util-flog 5 ( word "after sending consumers to shop at " T TNOW " the calendar length is " time:size-of-schedule ) end to monthly-payments set shopping-amount total-money / initial-public set total-money 0 ask public [ set private-wealth private-wealth + shopping-amount ] util-flog 5 ( word "AT END OF MONTH CONSUMERS RECEIVED THEIR SALARIES " T TNOW ) util-flog 5 ( list "extorters: " sum [ wealth ] of extorters ", shops: " sum [ shop-wealth ] of shops ", confiscated: " confiscated ", bank: " total-money ", in private pockets: " sum [ private-wealth ] of public ) ask extorters [ consume ] util-flog 5 ( word "AT END OF MONTH EXTORTERS PAID FOR THEIR CONSUMPTION " T TNOW ) util-flog 5 ( list "extorters: " sum [ wealth ] of extorters ", shops: " sum [ shop-wealth ] of shops ", confiscated: " confiscated ", bank: " total-money ", in private pockets: " sum [ private-wealth ] of public ) compensate util-flog 5 ( word "AT END OF MONTH THE STATE MIGHT HAVE COMPENSATED SOME SHOPS " T TNOW ) util-flog 5 ( list "extorters: " sum [ wealth ] of extorters ", shops: " sum [ shop-wealth ] of shops ", confiscated: " confiscated ", bank: " total-money ", in private pockets: " sum [ private-wealth ] of public ) ask shops [ update-shop-variables-at-end-of-month ] util-flog 5 ( word "AT END OF MONTH SHOPS PAID FOR THEIR EXPENSES " T TNOW ) util-flog 5 ( list "extorters: " sum [ wealth ] of extorters ", shops: " sum [ shop-wealth ] of shops ", confiscated: " confiscated ", bank: " total-money ", in private pockets: " sum [ private-wealth ] of public ) time-schedule-event "observer" task [ monthly-payments ] "monthly-payments" ( time:plus TNOW 1 "month" ) util-flog 0 ( word "after monthly payments at " T TNOW " the calendar length is " time:size-of-schedule ) end ;; an extorter spends its money once per period (as consume is called once a week a period is a week here) to consume if state = "active" or state = "active was in jail" [ let c consumption-per-period if c > wealth [ set c wealth ] set wealth wealth - c set total-money total-money + c ] end ;; at the beginning of each period shops set some variables to set-shop-variables-for-next-period set old-wealth shop-wealth set current-customers count public with [ my-current-shop = myself ] set volume-of-sales-this-month 0 set volume-of-loss-this-month 0 end to update-shop-variables-at-end-of-month ;; buy supply for inventory and pay salaries set monthly-income volume-of-sales-this-month util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW ) let expenses-per-period fixed-cost-per-period + variable-cost-coefficient * volume-of-sales-this-month if expenses-per-period > shop-wealth [ set expenses-per-period shop-wealth ] set shop-wealth shop-wealth - expenses-per-period set total-money total-money + expenses-per-period util-flog 5 ( word "sales past month: " volume-of-sales-this-month ", losses: " volume-of-loss-this-month ", expenses past month: " expenses-per-period ", new shop wealth: " shop-wealth ) if not bankrupt? and shop-wealth <= 0 [ close-down ] end ;; consumers buy to buy-from [ a-shop ] if not is-shop? a-shop [ util-flog 0 ( word "ERROR; buy-from; " a-shop " is not a shop" ) stop ] if a-shop = nobody [ util-flog 0 ( word "ERROR; buy-from; " a-shop " is nobody" ) stop ] let my-shopping-amount consumption-rate * shopping-amount / 6 ask a-shop [ set shop-wealth shop-wealth + my-shopping-amount set volume-of-sales-this-month volume-of-sales-this-month + my-shopping-amount util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", sale this month: " volume-of-sales-this-month ", old-wealth: " old-wealth " at " T TNOW ) ] set private-wealth private-wealth - my-shopping-amount ifelse [ addio-pizzo? ] of a-shop [ set count-addio-pizzo-shopping count-addio-pizzo-shopping + 1 ] [ set count-non-addio-pizzo-shopping count-non-addio-pizzo-shopping + 1 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES USED BY ALL TYPES OF AGENTS (EXCEPT VILLAGES) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; all kinds of agents calculate the salience of one norm when they need to make a decision which relates to this norm ;; they use these salience to calculate action propensities to-report propensity-to [ action ] calculate-my-individual-drive-to action calculate-my-normative-drive-to action let a-prop ( IDW * individual-drive + NDW * normative-drive ) if a-prop > 1 or a-prop < 0 [ util-flog (-2) ( word "ERROR: a-prop out of bounds: " a-prop " = " IDW "*" individual-drive " + " NDW "*" normative-drive ) ] report a-prop end to calculate-my-normative-drive-to [ action ] if action = "PAY" [ calculate-a-salience "DO-NOT-PAY-EXTORTION" calculate-a-salience "PAY-EXTORTION-AS-EVERYBODY-DOES" let np-dont position "DO-NOT-PAY-EXTORTION" my-norms let np-do position "PAY-EXTORTION-AS-EVERYBODY-DOES" my-norms let normative-drive-to-pay item np-do my-norm-saliences let normative-drive-not-to-pay item np-dont my-norm-saliences ifelse normative-drive-to-pay > normative-drive-not-to-pay [ set normative-drive normative-drive-to-pay ] [ set normative-drive 1 - normative-drive-not-to-pay ] ] if action = "DENOUNCE" [ calculate-a-salience "DO-NOT-DENOUNCE" calculate-a-salience "DENOUNCE-EXTORTION" let np-dont position "DO-NOT-DENOUNCE" my-norms let np-do position "DENOUNCE-EXTORTION" my-norms let normative-drive-to-denounce item np-do my-norm-saliences let normative-drive-not-to-denounce item np-dont my-norm-saliences ifelse normative-drive-to-denounce > normative-drive-not-to-denounce [ set normative-drive normative-drive-to-denounce ] [ set normative-drive 1 - normative-drive-not-to-denounce ] ] if action = "BECOME PENTITO" [ calculate-a-salience "ABJURE-CRIME" calculate-a-salience "DO-NOT-BETRAY-COLLEAGUES" let np-dont position "DO-NOT-BETRAY-COLLEAGUES" my-norms let np-do position "ABJURE-CRIME" my-norms let normative-drive-to-denounce item np-do my-norm-saliences let normative-drive-not-to-denounce item np-dont my-norm-saliences ifelse normative-drive-to-denounce > normative-drive-not-to-denounce [ set normative-drive normative-drive-to-denounce ] [ set normative-drive 1 - normative-drive-not-to-denounce ] ] if action = "PROSECUTE" [ calculate-a-salience "TRY-HARD-TO-IMPRISON" calculate-a-salience "ANXIETY-IS-JUSTIFIED" let np-dont position "ANXIETY-IS-JUSTIFIED" my-norms let np-do position "TRY-HARD-TO-IMPRISON" my-norms let normative-drive-to-prosecute item np-do my-norm-saliences let normative-drive-not-to-prosecute item np-dont my-norm-saliences ifelse normative-drive-to-prosecute > normative-drive-not-to-prosecute [ set normative-drive normative-drive-to-prosecute ] [ set normative-drive 1 - normative-drive-not-to-prosecute ] ] if action = "SWITCH TO ADDIO-PIZZO SHOP" [ calculate-a-salience "DO-NOT-SHOP-AT-EXTORTION-PAYER" calculate-a-salience "BUY-FROM-EXTORTION-PAYER" let np-dont position "BUY-FROM-EXTORTION-PAYER" my-norms let np-do position "DO-NOT-SHOP-AT-EXTORTION-PAYER"my-norms let normative-drive-to-switch item np-do my-norm-saliences let normative-drive-not-to-switch item np-dont my-norm-saliences ifelse normative-drive-to-switch > normative-drive-not-to-switch [ set normative-drive normative-drive-to-switch ] [ set normative-drive 1 - normative-drive-not-to-switch ] ;; show ( list normative-drive-to-switch normative-drive-not-to-switch normative-drive ) ] end to-report arctan [ argument ] report 1 - ( atan 1 argument ) / 180 end to calculate-my-individual-drive-to [ action ] if not any? out-pay-link-neighbors [ set individual-drive 0 stop ] if action = "PAY" [ let benefit benefit-for-victims let extortion [ extortion-level ] of max-one-of out-pay-link-neighbors [ extortion-level ] let state-punishment extortion * state-punishment-factor let T-pay ( benefit - extortion ) - ( state-punishment * ( 1 - percentage-of-undetected-cases ) ) * ( 1 - collaboration-probability ) let T-no-pay ( extortion - benefit ) - ( ( [ punishment-severity ] of max-one-of out-pay-link-neighbors [ extortion-level ] ) * percentage-of-cases-with-punishment ) let individual-drive-to-pay arctan (0.01 * T-pay ) let individual-drive-not-to-pay arctan ( 0.01 * T-no-pay ) set individual-drive individual-drive-to-pay / ( individual-drive-to-pay + individual-drive-not-to-pay ) ] if action = "DENOUNCE" [ set individual-drive ( 1 - percentage-of-undetected-cases ) * ( percentage-of-cases-with-punishment ) + percentage-of-critical-consumers ] if action = "PROSECUTE" [ set individual-drive 0 ] if action = "BECOME PENTITO" [ set individual-drive percentage-of-cases-with-punishment ] if action = "SWITCH TO ADDIO-PIZZO SHOP" [ set individual-drive 0.5 * [ shop-wealth ] of my-current-shop / mean-shop-wealth-non-addio-pizzo if individual-drive > 1 [ set individual-drive 1.0 ] ] end to calculate-a-salience [ a-norm ] let np position a-norm my-norms let C item np my-compliances let V item np my-violations let OC item np other-compliances let OV item np other-violations let P item np punishments let S item np sanctions let EC item np explicit-compliance-invocations let EV item np explicit-violations let numerator 0 let denominator 0 let OWN 0 if C + V > 0 [ set OWN ( C - V ) / ( C + V ) set numerator numerator + WC set denominator denominator + 2 * WC ] let OBS 0 if OC + OV > 0 [ set OBS ( OC - OV ) / ( OC + OV ) set numerator numerator + WO set denominator denominator + 2 * WO ] let NPV 0 if OV + V > 0 [ set NPV (OV + V - P - S ) if NPV < 0 [ set NPV 0 ] set NPV NPV / ( OV + V) set numerator numerator + WNPV set denominator denominator + WNPV ] let maxPSOV P + S if OV + V > P + S [ set maxPSOV OV + V ] let P_max 0 if maxPSOV > 0 [ set P_max P / maxPSOV set denominator denominator + WP ] let S_max 0 if maxPSOV > 0 [ set S_max S / maxPSOV set denominator denominator + WS ] let ECEV 0 if EC + EV > 0 [ set ECEV ( EC - EV ) / ( EC + EV ) set numerator numerator + WE set denominator denominator + 2 * WE ] let SAL 0 if denominator > 0 [ set SAL ( ( numerator + OWN * WC + OBS * WO - NPV * WNPV + P_max * WP + S_max * WS + ECEV * WE ) / denominator ) ] set my-norm-saliences replace-item np my-norm-saliences SAL set n-sal n-sal + 1 if SAL < min-sal [ set min-sal SAL ] if SAL > max-sal [ set max-sal SAL ] end ;; all kinds of agents update their individual event board to update-compliances [ a-norm ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np my-compliances set my-compliances replace-item np my-compliances ( old-value * DISCOUNT + 1 ) ] ask ( turtle-set shops extorters public police ) in-radius LOCAL [ update-observed-compliances a-norm ] end to update-violations [ a-norm ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np my-violations set my-violations replace-item np my-violations ( old-value * DISCOUNT + 1 ) ] ask ( turtle-set shops extorters public police ) in-radius LOCAL [ update-observed-violations a-norm ] end to update-observed-compliances [ a-norm ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np other-compliances set other-compliances replace-item np other-compliances ( old-value * DISCOUNT + 1 ) ] end to update-observed-violations [ a-norm ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np other-violations set other-violations replace-item np other-violations ( old-value * DISCOUNT + 1 ) ] end to update-punishments [ a-norm depth caller id ] if id = last-message-id [ stop ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np punishments set punishments replace-item np punishments ( old-value * DISCOUNT + 1 ) ] if depth = 0 [ ask ( turtle-set shops extorters public police ) in-radius LOCAL [ if member? a-norm my-norms [ update-punishments a-norm 1 myself message-id update-explicit-compliance-invocations a-norm 1 myself message-id ] ] ] set last-message-id id end to update-sanctions [ a-norm depth caller id ] if id = last-message-id [ stop ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np sanctions set sanctions replace-item np sanctions ( old-value * DISCOUNT + 1 ) ] if depth = 0 [ ask ( turtle-set shops extorters public police ) in-radius LOCAL [ if member? a-norm my-norms [ update-sanctions a-norm 1 myself message-id update-explicit-compliance-invocations a-norm 1 myself message-id ] ] ] set last-message-id id end to update-explicit-compliance-invocations [ a-norm depth caller id ] if id = last-message-id [ stop ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np explicit-compliance-invocations set explicit-compliance-invocations replace-item np explicit-compliance-invocations ( old-value * DISCOUNT + 1 ) ] if depth = 0 [ ask ( turtle-set shops extorters public police ) in-radius LOCAL [ if member? a-norm my-norms [ update-sanctions a-norm 1 myself message-id update-explicit-compliance-invocations a-norm 1 myself message-id ] ] ] set last-message-id id end to update-explicit-violations [ a-norm depth caller id ] if id = last-message-id [ stop ] if member? a-norm my-norms [ let np position a-norm my-norms let old-value item np explicit-violations set explicit-violations replace-item np explicit-violations ( old-value * DISCOUNT + 1 ) ] if depth = 0 [ let addressees ( turtle-set shops extorters public police ) with [ member? a-norm my-norms ] in-radius LOCAL ask addressees [ if member? a-norm my-norms [ update-sanctions a-norm 1 myself message-id update-explicit-violations a-norm 1 myself message-id ] ] ] set last-message-id id end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES USED BY STATE AND POLICE (STATE IS THE GLOBAL LEVEL) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; the state (the observer !!) compensates victims of extortion; the recipient receives invocations ;; of the three norms DO-NOT-PAY-EXTORTION, DENOUNCE-EXTORTION, and PAY-EXTORTION-AS-EVERYBODY-DOES ;; the latter being negative to compensate while [ confiscated > initial-wealth-max and any? shops with [ amount-of-recent-punishment > 0 ] ] [ ask min-one-of ( shops with [ amount-of-recent-punishment > 0 and amount-of-recent-punishment < confiscated ] ) [ date-of-recent-punishment ] [ let compensation amount-of-recent-punishment set confiscated confiscated - compensation set shop-wealth shop-wealth + compensation set volume-of-loss-this-month volume-of-loss-this-month - compensation util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW ) set message-id message-id + 1 update-explicit-compliance-invocations "DO-NOT-PAY-EXTORTION" 0 self message-id update-explicit-compliance-invocations "DENOUNCE-EXTORTION" 0 self message-id update-explicit-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" 0 self message-id update-explicit-violations "DO-NOT-DENOUNCE" 0 self message-id set amount-of-recent-punishment 0 set date-of-recent-punishment 0 if bankrupt? [ set bankrupt? false set color sky if random-float 1.0 < hide-denounce-propensity [ declare-membership-in-addio-pizzo ] util-flog 5 ( word " reactivated after compensation at " T TNOW ) ] util-flog 5 ( word T TNOW ": compensated " self " with " compensation ", " confiscated " left for further compensation " ) ] ] end ;; the court (only one, and this one court is also represented by the observer) finds a criminal guilty with ;; a certain probability and sends it to jail for some longer time and, if the criminal had been denounced ;; by the victim, the latter receives a remuneration which is 10 per cent of the money and other assets ;; found with the criminal the other 90 per cent being transferred to compensation fund ;; all police receive invocations of the norm TRY-HARD-TO-IMPRISON to convict [ criminal denouncer ] if [ state = "in-jail" ] of criminal [ stop ] if criminal != nobody [ ask criminal [ update-explicit-compliance-invocations "ABJURE-CRIME" 0 self message-id ifelse random-float 1.0 < conviction-probability [ change-entry self denouncer i-convicted-at TNOW set state "in jail" let years-in-jail (3 + random 5 ) change-amount self denouncer i-sentence years-in-jail time-schedule-event self task leave-jail "leave-jail" ( time:plus TNOW years-in-jail "year" ) util-flog 5 ( word " sentenced to " years-in-jail " years until " T ( time:plus TNOW years-in-jail "year" ) ) util-flog 5 ( word "after having been sentenced to " years-in-jail " years in jail at " T TNOW " the calendar length is " time:size-of-schedule ) ifelse denouncer != nobody [ set confiscated confiscated + wealth * 0.9 let remuneration wealth * 0.1 ask denouncer [ set shop-wealth shop-wealth + remuneration set volume-of-loss-this-month volume-of-loss-this-month - remuneration util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW " after award for denunciation") ] ] [ set confiscated confiscated + wealth ] set wealth 0 set color grey become-inactive update-compliances "TRY-HARD-TO-IMPRISON" update-violations "ANXIETY-IS-JUSTIFIED" ask police [ update-observed-compliances "TRY-HARD-TO-IMPRISON" ] ask police [ update-observed-violations "ANXIETY-IS-JUSTIFIED" ] set my-ruefulness propensity-to "BECOME PENTITO" ] [ change-entry self denouncer i-convicted-at TNOW change-amount self denouncer i-sentence 0 set state "active" time-schedule-event self task [ become-active ] "become-active" ( time:plus TNOW 24 "hours" ) util-flog 5 ( word "after extorter was acquitted it becomes active again 24 hours after " T TNOW " the calendar length is " time:size-of-schedule ) ] ifelse random-float 1.0 < my-ruefulness [ become-inactive become-rueful ] [ update-explicit-compliance-invocations "DO-NOT-BETRAY-COLLEAGUES" 0 self message-id ] ] ] end ;; police prosecute extorters; the success rate depends on the salience of the norm "TRY-HARD-TO-IMPRISON", ;; and all offenders are prosecuted and in case of success are kept in investigation custody, evenually a court ;; sends them to jail ;; unsuccessful police officers are criticised for having violated the TRY-HARD-TO-IMPRISON norm ;; the other police officers observe such a norm violation ;; in the case of success the opposite holds, of course to start-prosecute [ offender denouncer ] if [ state != "active" ] of offender [ stop ] ifelse is-extorter? offender [ set criminal-records ( turtle-set criminal-records offender ) ] [ util-flog 0 ( word "ERROR (prosecute): " offender " is not an extorter!" ) ] set my-prosecution-propensity propensity-to "PROSECUTE" util-flog 5 ( word " received criminal charge against " offender " from " denouncer " or observed the former attacking the latter at " T TNOW ) ifelse random-float 1.0 < my-prosecution-propensity [ change-entry offender denouncer i-prosecution-start TNOW let delay random-float-in-range 0 5000 time-schedule-event self task [ put-to-custody offender denouncer ] "put-to-custody offender denouncer" ( time:plus TNOW delay "hours" ) util-debug "prosecute: "self offender denouncer util-flog 5 ( word "prosecution by " self " starts " T TNOW ) util-flog 5 ( word offender " will be arrested at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after having decided to prosecute " offender " at " T TNOW " within " delay "hours the calendar length is " time:size-of-schedule ) update-compliances "TRY-HARD-TO-IMPRISON" update-violations "ANXIETY-IS-JUSTIFIED" ask police in-radius LOCAL [ update-observed-compliances "TRY-HARD-TO-IMPRISON" update-explicit-violations "ANXIETY-IS-JUSTIFIED" 0 self message-id ] ] [ util-flog 5 ( word "prosecuting " offender " by " self " refused at " T TNOW ) update-violations "TRY-HARD-TO-IMPRISON" update-compliances "ANXIETY-IS-JUSTIFIED" update-explicit-compliance-invocations "ANXIETY-IS-JUSTIFIED" 0 self message-id ask police in-radius LOCAL [ update-observed-violations "TRY-HARD-TO-IMPRISON" update-observed-compliances "ANXIETY-IS-JUSTIFIED" update-explicit-compliance-invocations "ANXIETY-IS-JUSTIFIED" 0 self message-id ] ] end to put-to-custody [ an-extorter a-victim ] if [ state != "active" ] of an-extorter [ stop ] ifelse random-float 1 < escape-chance [ util-flog 5 ( word an-extorter ", denounced by " a-victim " escaped " T TNOW ) let delay random-float-in-range 360 720 time-schedule-event an-extorter task [ become-active ] "become active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word "after after not having found " an-extorter " at " T TNOW " the latter will become active again within " delay " hours the calendar length is " time:size-of-schedule ) ] [ change-entry an-extorter a-victim i-arrested-at TNOW util-debug "arrest: " self an-extorter a-victim if an-extorter != nobody [ ask an-extorter [ set state "arrested" ] ] let delay random-float-in-range 720 5000 ask an-extorter [ become-inactive ] time-schedule-event self task [ convict an-extorter a-victim ] "convict an-extorter a-victim" ( time:plus TNOW delay "hours" ) util-flog 5 ( word an-extorter ", denounced by " a-victim " was arrested at " T TNOW ) util-flog 5 ( word an-extorter ", denounced by " a-victim " will be convicted at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after having decided to put " an-extorter " to custody at " T TNOW " within " delay " hours the calendar length is " time:size-of-schedule ) ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES USED BY CONSUMERS (THE PUBLIC) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; consumers decide to sanction a shop paying pizzo to switch-to-addio-pizzo-shop set message-id message-id + 1 let my-former-shop my-current-shop ask my-former-shop [ update-sanctions "DO-NOT-PAY-EXTORTION" 0 myself message-id ] ask my-former-shop [ update-explicit-violations "DO-NOT-PAY-EXTORTION" 0 myself message-id ] ask my-former-shop [ update-sanctions "DENOUNCE-EXTORTION" 0 myself message-id ] ask my-former-shop [ update-explicit-violations "DENOUNCE-EXTORTION" 0 myself message-id ] ask public in-radius LOCAL [ update-explicit-compliance-invocations "DO-NOT-SHOP-AT-EXTORTION-PAYER" 0 myself message-id ] ask public in-radius LOCAL [ update-observed-compliances "DO-NOT-SHOP-AT-EXTORTION-PAYER" ] ask public in-radius LOCAL [ update-explicit-violations "BUY-FROM-DENOUNCING-ENTREPRENEUR" 0 myself message-id ] ask public in-radius LOCAL [ update-observed-violations "BUY-FROM-DENOUNCING-ENTREPRENEUR" ] update-compliances "DO-NOT-SHOP-AT-EXTORTION-PAYER" let potential-shops shops with [ addio-pizzo? and not bankrupt? ] if count potential-shops > 0 [ set my-current-shop min-one-of potential-shops [ current-customers ] util-flog 5 ( word " switched from " my-former-shop " to addio-pizzo " my-current-shop " at " T TNOW ) ] end to support-pizzo-paying-shop set message-id message-id + 1 ask shops in-radius LOCAL [ update-explicit-compliance-invocations "PAY-EXTORTION-AS-EVERYBODY-DOES" 0 self message-id update-explicit-violations "DO-NOT-DENOUNCE" 0 self message-id ] ask public in-radius LOCAL [ update-explicit-violations "DO-NOT-SHOP-AT-EXTORTION-PAYER" 0 self message-id ] update-compliances "BUY-FROM-DENOUNCING-ENTREPRENEUR" ask public in-radius LOCAL [ update-observed-compliances "BUY-FROM-DENOUNCING-ENTREPRENEUR" ] end ;; consumers go shopping to go-shopping let my-former-shop my-current-shop if my-current-shop != nobody [ if [ bankrupt? or current-customers > max-customers ] of my-current-shop [ set my-current-shop nobody ] ] if my-current-shop = nobody [ let active-shops shops with [ not bankrupt? ] set my-current-shop min-one-of active-shops [ current-customers ] ] if not any? shops with [ not bankrupt? ] [ stop ] if not is-shop? my-current-shop [ util-flog 0 ( word "ERROR; go-shopping; " my-current-shop " is not a shop" ) stop ] ifelse [ addio-pizzo? ] of my-current-shop [ update-violations "BUY-FROM-EXTORTION-PAYER" update-compliances "DO-NOT-SHOP-AT-EXTORTION-PAYER" ] [ update-compliances "BUY-FROM-EXTORTION-PAYER" update-violations "DO-NOT-SHOP-AT-EXTORTION-PAYER" ] set my-addio-pizzo-buy-propensity propensity-to "SWITCH TO ADDIO-PIZZO SHOP" if [ not addio-pizzo? ] of my-current-shop [ ifelse random-float 1.0 < my-addio-pizzo-buy-propensity [ switch-to-addio-pizzo-shop ] [ support-pizzo-paying-shop ] ] if [ not bankrupt? ] of my-current-shop [ buy-from my-current-shop ] if not is-batch? [ set distance-to-my-current-shop distance my-current-shop set color scale-color black distance-to-my-current-shop max-shop-distance 1 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES USED BY SHOPS ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; this procedure covers the shop owner's decision making and also reports extortion case ;; even those wich never become known to the police to wait-for-extorter ;; check whether extortion is requested (no extortion before 08:00 !!) let me self ifelse time:get "hour" TNOW > 7 and count my-out-pay-links > 0 [ ;; an extortion is pending util-flog 5 ( word "waiting for extorters " sort-by [ [ who ] of ?1 < [ who ] of ?2 ] out-pay-link-neighbors " at " T TNOW ) if count my-out-pay-links > 1 [ get-rid-of-other-extorters ] if not any? out-pay-link-neighbors with [ state = "active" ] [ util-flog 5 "no active extorters left" stop ] let my-current-extorter one-of out-pay-link-neighbors with [ state = "active" ] util-flog 5 word "my current extorter is " my-current-extorter add-entry my-current-extorter me TNOW NULL NULL NULL 0 NULL 0 NULL NULL 0 let officer one-of police in-radius vision-range let extortion-paid NULL set my-denunciation-propensity propensity-to "DENOUNCE" let my-propensity-to-pay propensity-to "PAY" if not is-shop? me [ util-flog 0 ( word "ERROR; wait-for-extorter; " self " is not a shop" ) stop ] ifelse ( random-float 1.0 < my-denunciation-propensity * ( 1 - my-propensity-to-pay ) ) or addio-pizzo? [ denounce util-flog 5 ( word "decided to denounce " my-current-extorter " at " T TNOW " and cuts links to extorters ") ifelse officer != nobody [ let delay random-float-in-range 12 84 let time-for-prosecution ( time:plus TNOW delay "hours" ) time-schedule-event officer task [ start-prosecute my-current-extorter me ] "start-prosecute my-current-extorter me" time-for-prosecution util-debug "wait-for-extorter-denounce: " officer my-current-extorter me util-flog 5 ( word "police " officer " will start prosecuting " my-current-extorter " ( denounced by " me " ) at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after " officer " has decided to prosecute at " T TNOW " within " delay " hours the calendar length is " time:size-of-schedule ) ] [ util-flog 5 ( word "no police available to prosecute " my-current-extorter " at " T TNOW ) ] ask my-out-pay-links [ die ] ask my-in-threaten-links [ die ] ask police in-radius LOCAL [ update-explicit-compliance-invocations "TRY-HARD-TO-IMPRISON" 0 self message-id] change-entry my-current-extorter self i-denounced-at TNOW let delay random-float 168 time-schedule-event my-current-extorter task [ punish me ] "punish me" ( time:plus TNOW delay "hours" ) util-flog 5 ( word my-current-extorter " is expected to punish " me " at " T ( time:plus TNOW delay "hours" ) ) set delay random-float-in-range 24 168 time-schedule-event my-current-extorter task [ become-active ] "become-active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word my-current-extorter " is scheduled to become active again at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after having decided to punish and to become active again at " T TNOW " within " delay " hours the calendar length is " time:size-of-schedule ) ;; decide-to-pay-or-not ;; paying pizzo when the extorter was denounced should occur only rarely util-flog 5 ( word "propensity to denounce: " my-denunciation-propensity ", to pay: " my-propensity-to-pay ", DENOUNCES" ) ] [ util-flog 5 ( word "decided not to denounce " my-current-extorter " at " T TNOW ) util-flog 5 ( word "will decide whether to satisfy " my-current-extorter " or not " ) set extortion-paid decide-to-pay-or-not ;; only when the shop decided not to denounce util-flog 5 ( word " already paid " extortion-paid " to " my-current-extorter " at " T TNOW ) ifelse extortion-paid > 0 [ change-amount my-current-extorter self i-amount-paid extortion-paid change-entry my-current-extorter self i-paid-at TNOW time-schedule-event my-current-extorter task [ return-to me ] "return-to me" ( time:plus TNOW ( random-float-in-range 600 700 ) "hours" ) util-flog 5 ( word "propensity to denounce: " my-denunciation-propensity ", to pay: " my-propensity-to-pay ", PAYS" ) ] [ util-flog 5 ( word "did not pay " my-current-extorter " at " T TNOW " and cuts links to extorters ") time-schedule-event my-current-extorter task [ punish me ] "punish me" ( time:plus TNOW ( random-float 168 ) "hours" ) util-flog 5 ( word "propensity to denounce: " my-denunciation-propensity ", to pay: " my-propensity-to-pay ", DOES NOT PAY" ) ] util-flog 5 ( word "after having decided between returning (slightly less than a month later) and punishing (within a week) at " T TNOW " the calendar length is " time:size-of-schedule ) if any? criminal-records [ if member? my-current-extorter criminal-records [ if any? police in-radius vision-range [ ifelse officer != nobody [ let delay random-float-in-range 12 84 let time-for-prosecution ( time:plus TNOW delay "hours" ) time-schedule-event officer task [ start-prosecute my-current-extorter me ] "start-prosecute my-current-extorter me" time-for-prosecution util-debug "wait-for-extorter-undenounced: " officer my-current-extorter me util-flog 5 ( word "police " officer " will start prosecuting " my-current-extorter " ( undenounced, attacked " me " ) at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after " officer " has decided to prosecute at " T TNOW " within " delay " hours the calendar length is " time:size-of-schedule ) ] [ util-flog 5 ( word "no police available to prosecute " my-current-extorter " at " T TNOW ) ] update-violations "DENOUNCE-EXTORTION" update-compliances "DO-NOT-DENOUNCE" update-punishments "DENOUNCE-EXTORTION" 0 self message-id ] ] ] ] ] [ let reason " as shop was closed over night at " let delay random-float-in-range 600 700 time-schedule-event potential-extorter task [ return-to me ] "return-to me" ( time:plus TNOW delay "hours" ) ifelse [ state != "active" ] of potential-extorter or count my-out-pay-links = 0 [ if [ state = "penniless" ] of potential-extorter [ set reason " as potential extorter was penniless " ] if [ state = "arrested" ] of potential-extorter [ set reason " as potential extorter is under custody " ] if [ state = "in jail" ] of potential-extorter [ set reason " as potential extorter was sentenced to jail " ] if [ state = "pentito" ] of potential-extorter [ set reason " as potential extorter is now pentito " ] ] [ time-schedule-event potential-extorter task [ return-to me ] "return-to me" ( time:plus TNOW delay "hours" ) util-flog 5 ( word potential-extorter " will visit " me " again at " T ( time:plus TNOW delay "hours" ) ) ] util-flog 5 ( word "victim " self " did not meet " potential-extorter reason T TNOW ", " count extorters with [ state = "active" ] " extorters currently active" ) util-flog 5 ( word "after unsuccessful attempt at " T TNOW " the calendar length is " time:size-of-schedule ) ] end ;; shops decide to resist extortion ;; they know that have violated the PAY-EXTORTION-AS-EVERYBODY-DOES norm ;; the public and the shops receive invocation of the norms DO-NOT-SHOP-AT-EXTORTION-PAYER ;; and DO-NOT-PAY-EXTORTION, respectively to declare-membership-in-addio-pizzo if not is-shop? self [ util-flog 0 ( word "ERROR; declare-membership-in-addio-pizzo; " self " is not a shop" ) stop ] set addio-pizzo? true ask my-links [ die ] set message-id message-id + 1 ask public in-radius LOCAL [ update-sanctions "DO-NOT-SHOP-AT-EXTORTION-PAYER" 0 myself message-id ] ask shops in-radius LOCAL [ update-sanctions "DO-NOT-PAY-EXTORTION" 0 myself message-id ] update-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" set color red util-flog 5 ( word " joins addio-pizzo at " T TNOW ) end ;; shops denounce an extorter, in the non-norm version only when they have not paid pizzo; but one could think even here of having them denounce even after they have paid pizzo to denounce let nearest-police-officer min-one-of police [ distance myself ] let my-extorters out-pay-link-neighbors set message-id message-id + 1 update-compliances "DENOUNCE-EXTORTION" update-violations "DO_NOT_DENOUNCE" update-compliances "DO-NOT-PAY-EXTORTION" ask shops in-radius LOCAL [ update-observed-compliances "DENOUNCE-EXTORTION" ] ask shops in-radius LOCAL [ update-observed-violations "DO-NOT-DENOUNCE" ] ask shops in-radius LOCAL [ update-observed-compliances "DO-NOT-PAY-EXTORTION" ] ask police in-radius LOCAL [ update-explicit-compliance-invocations "TRY-HARD-TO-IMPRISON" 0 self message-id ] if not is-shop? self [ util-flog 0 ( word "ERROR; denounce; " self " is not a shop" ) stop ] if not addio-pizzo? and random-float 1.0 < hide-denounce-propensity [ declare-membership-in-addio-pizzo util-flog 5 ( word " declared membership in addio-pizzo at " T TNOW ) ] end to-report decide-to-pay-or-not let extortion-paid 0 if not is-shop? self [ util-flog 0 ( word "ERROR; decide-to-pay-or-not; " self " is not a shop" ) stop ] if not any? out-pay-link-neighbors with [ state = "active" ] [ util-flog 5 "no active extorters left" stop ] ifelse addio-pizzo? [ ask my-out-pay-links [ die ] ask my-in-threaten-links [ die ] ] ;; addio-pizzo members never pay [ util-flog 5 word "about to decide whether I pay or not at " T TNOW set my-pay-extortion-propensity propensity-to "PAY" ifelse ( random-float 1.0 < my-pay-extortion-propensity ) [ set extortion-paid pay-extortion let my-extorter max-one-of out-pay-link-neighbors [ punishment-severity ] let delay 0 ifelse extortion-paid <= 0 [ set delay random-float-in-range 8 12 ] [ set delay random-float-in-range 160 240 ] time-schedule-event my-extorter task become-active "become-active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word my-extorter " plans to attempt at extorting anew at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after victim has decided to pay " extortion-paid " at " T TNOW " within " delay " hours the calendar length is " time:size-of-schedule ) set message-id message-id + 1 update-violations "DO-NOT-PAY-EXTORTION" update-compliances "PAY-EXTORTION-AS-EVERYBODY-DOES" ask shops in-radius LOCAL [ update-observed-violations "DO-NOT-PAY-EXTORTION" ] set time-of-last-completed-extortion ticks ] [ let my-extorter max-one-of out-pay-link-neighbors [ punishment-severity ] let delay random-float-in-range 8 12 time-schedule-event my-extorter task become-active "become-active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word my-extorter " plans to attempt at extorting anew at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after victim has decided not to pay at " T TNOW ", the extorter plans to return within " delay " hours, and the calendar length is " time:size-of-schedule ) ask my-out-pay-links [ die ] ask my-in-threaten-links [ die ] update-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" ask shops in-radius LOCAL [ update-observed-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" ] update-compliances "DO-NOT-PAY-EXTORTION" ask shops in-radius LOCAL [ update-observed-violations "DO-NOT-PAY-EXTORTION" ] ] ] report extortion-paid end ;; competing extorters, shops decide to whom to pay to get-rid-of-other-extorters let my-extorter max-one-of out-pay-link-neighbors [ punishment-severity ] let other-extorters out-pay-link-neighbors while [ count out-pay-link-neighbors > 1 ] [ ask my-extorter [ protect-me-against myself other-extorters ] set other-extorters out-pay-link-neighbors ] end ;; shops pay extortion; they know that they have violated the DO-NOT-PAY-EXTORTION norm and that they have complied ;; with the PAY-EXTORTION-AS-EVERYBODY-DOES norm; the neighbouring shops observe this to-report pay-extortion if not any? out-pay-link-neighbors [ report -1 ] let my-extorter max-one-of ( out-pay-link-neighbors with [ state = "active" ] ) [ punishment-severity ] let extortion-rate [ extortion-now ] of my-extorter let extortion monthly-income * extortion-rate / 100 util-flog 5 ( word "the extortion to be paid by " self " to " my-extorter " at " T TNOW " will be " extortion " = " monthly-income " times " ( extortion-rate / 100 ) ) if extortion > shop-wealth [ set extortion shop-wealth ] if extortion < 0 [ set extortion 0 ] set shop-wealth shop-wealth - extortion set volume-of-loss-this-month volume-of-loss-this-month + extortion util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW ) ask my-extorter [ set wealth wealth + extortion ] update-violations "DO-NOT-PAY-EXTORTION" update-compliances "PAY-EXTORTION-AS-EVERYBODY-DOES" ask shops in-radius LOCAL [ update-observed-violations "DO-NOT-PAY-EXTORTION"] ask shops in-radius LOCAL [ update-observed-compliances "PAY-EXTORTION-AS-EVERYBODY-DOES" ] if count out-pay-link-neighbors > 1 [ let other-extorters out-pay-link-neighbors while [ count out-pay-link-neighbors > 1 ] [ ask my-extorter [ protect-me-against myself other-extorters ] set other-extorters out-pay-link-neighbors ] ] util-flog 5 ( word "the extortion to be paid by " self " to " my-extorter " at " T TNOW " will be " extortion " = " monthly-income " times " ( extortion-rate / 100 ) ) report extortion end ;; a shop which paid pizzo asks the successful extorter to protect it against rivals; a norm invocation needs to be added ;; this norm might be something like NEVER-EXTORT-SHOPS-PROTECTED-BY-ANOTHER-FAMILY, but this is not yet defined to protect-me-against [ protection-seeker rivals ] if not any? other rivals [ stop ] set my-family family if my-family = -1 [ set ERROR-OCCURRED? true stop ] ask other rivals [ give-up protection-seeker subordinate-yourself-to myself ] end ;; a shop is bankrupt and decides to give up; a norm invocation needs to be added to give-up [ your-shop ] ask my-in-pay-links with [ other-end = your-shop ] [ die ] ask my-out-threaten-links with [ other-end = your-shop ] [ die ] let new-attempt-time time:plus TNOW ( random-float-in-range 24 72 ) "hours" time-schedule-event self task [ become-active ] "become-active" new-attempt-time ifelse is-shop? your-shop [ set forbidden-shops ( turtle-set forbidden-shops your-shop ) ] [ util-flog 0 ( word "ERROR (give-up): " your-shop " is not a shop" ) ] util-flog 5 ( word "has given up to extort " your-shop " and starts to find other victims at " T new-attempt-time ) util-flog 5 ( word "will not approach shops " sort [ who ] of forbidden-shops ) end ;; a shop closes to close-down ask out-pay-link-neighbors [ give-up myself ] util-flog 5 ( word " closes because of negative capital of " shop-wealth " (bank loss ) at " T TNOW ) set total-money total-money + shop-wealth set shop-wealth 0 util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW ) set bankrupt? true set color black end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; PROCEDURES USED BY EXTORTERS ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; this procedure collects all activities of an extorter during one period to become-active if state != "active" [ stop ] ask patches in-radius extortion-radius [ if ( pcolor mod 10 ) = 6 [ set pcolor pcolor + 1 ] ] ifelse time:get "hour" TNOW > 7 ;; when this is 0 extortion can happen at all times of a day [ util-flog 5 ( word "becomes active at " T TNOW ", state is " state ) util-flog 5 ( word "has " count my-in-pay-links " in-pay-links (0) and there are " count shops with [ count my-in-threaten-links = 0 ] " shops without threaten-links (>0)" ) ifelse state = "active" [ if count my-in-pay-links = 0 or any? shops with [ count my-in-threaten-links = 0 ] [ util-flog 5 ( word "and starts to find victims at " T TNOW ", currently " count extorters with [ state = "active" ] " extorters active " ) find-victims ] ] [ util-flog 5 ( word "but cannot extort as its state is " state " at " T TNOW ) ] if state = "active"and wealth <= 0 ;; if an extorter has spent all its money for consumtive purposes it becomes inactive until its family helps it up [ ask out-threaten-link-neighbors [ ask myself [ give-up self ] ] set state "penniless" set color white set total-money total-money + wealth set wealth 0 ] ] [ ;; this happans only if extortions are restricted to the later hours of a day time-schedule-event self task [ become-active ] "become-active" ( time:plus TNOW 730 "hours" ) util-flog 5 ( word "after extorter has decided to become active again at " T TNOW " within about a month, the calendar length is " time:size-of-schedule ) ] end to return-to [ a-victim ] if state != "active" [ stop ] let delay ( random-float-in-range 5 72 ) time-schedule-event a-victim task wait-for-extorter "wait-for-extorter" ( time:plus TNOW delay "hours" ) util-flog 5 ( word "after extorter has decided at " T TNOW " to return to " a-victim " within " delay " hours the calendar length is " time:size-of-schedule ) end to leave-jail ifelse state = "in jail" [ set state "active" let delay random-float-in-range 12 36 time-schedule-event self task become-active "become-active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word "leaves jail and becomes active again " T TNOW ) ] [ util-flog 5 ( word "leaves jail but does not become active as it is pentito at " T TNOW ) ] set was-in-jail? true color-extorter set extortion-radius initial-extortion-radius * 0.5 end ;; extorters try to find promising victims to find-victims let allowed-shops turtle-set nobody let me self ifelse random-float 1.0 < propensity-to-offend-addio-pizzo and count forbidden-shops > 5 [ set allowed-shops shops in-radius extortion-radius with [ not bankrupt? ] ] [ set allowed-shops shops in-radius extortion-radius with [ not addio-pizzo? and not bankrupt? ] ] util-flog 5 ( word "possible victims at " T TNOW " and their wealth: " [ list who shop-wealth ] of allowed-shops ) if count allowed-shops = 0 [ util-flog 5 word " no victims found " [ ( list who addio-pizzo? bankrupt? shop-wealth ) ] of shops if extortion-radius < 100 [ set extortion-radius extortion-radius-extension * extortion-radius ask patches in-radius extortion-radius [ if pcolor mod 10 = 6 [ set pcolor pcolor + 1 ] ] util-flog 5 ( word " extortion radius set to " extortion-radius " at " T TNOW ) ] ] util-flog 5 ( word "forbidden victims at " T TNOW " and their chracteristics: " [ list addio-pizzo? shop-wealth ] of forbidden-shops ) ask forbidden-shops [ set allowed-shops other allowed-shops if not is-shop? self [ util-flog 0 ( word "ERROR (find-victims, forbidden shops): " self " is not a shop" ) ] ] if random-float 1.0 < propensity-to-offend-addio-pizzo and 0 < count shops in-radius extortion-radius with [ addio-pizzo? and not bankrupt? ] [ let selected-anti-pizzo-shop one-of shops in-radius extortion-radius with [ addio-pizzo? and not bankrupt? ] set allowed-shops ( turtle-set selected-anti-pizzo-shop allowed-shops ) ] ifelse count allowed-shops > 0 [ let promising-shop max-one-of allowed-shops [ shop-wealth ] create-pay-links-from turtle-set promising-shop [ set color blue set shape "arc" set hidden? not show-extortion-links? ] create-threaten-links-to turtle-set promising-shop [ set color red set shape "arc" set hidden? not show-extortion-links? set extortion-start ticks set extortion-end -1 ] util-flog 5 ( word "victim is " promising-shop ", its wealth is " [ shop-wealth ] of promising-shop " at " T TNOW ) ask promising-shop [ set potential-extorter myself ] let delay random-float-in-range 0 72 ;; this a potential source of the error time-schedule-event promising-shop task wait-for-extorter "wait-for-extorter" ( time:plus TNOW delay "hours" ) ;; the following statements were inserted only for test purposes ;; if any? police in-radius vision-range ;; [ ;; let police-officer one-of police in-radius vision-range ;; let this-delay random-float-in-range 0 delay ;; time-schedule-event police-officer task [ start-prosecute me promising-shop ] "prosecute me promising-shop" ( time:plus TNOW this-delay "hours" ) ;; util-flog 5 ( word "police officer " police-officer " observed " self "=" me " approaching " promising-shop " and starts prosecuting" ) ;; ] util-flog 5 ( word "victim " promising-shop " will meet " self " at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after " self " has decided at " T TNOW " to visit " promising-shop " within " delay " hours the calendar length is " time:size-of-schedule ) ] [ let delay random-float-in-range 150 200 time-schedule-event self task become-active "become-active" ( time:plus TNOW delay "hours" ) util-flog 5 ( word self " could not find a promising victim and will try again at " T ( time:plus TNOW delay "hours" ) ) util-flog 5 ( word "after extorter has decided at " T TNOW " to return " delay " hours later the calendar length is " time:size-of-schedule ) if extortion-radius < 100 [ set extortion-radius extortion-radius-extension * extortion-radius ask patches in-radius extortion-radius [ if pcolor mod 10 = 6 [ set pcolor pcolor + 1 ] ] util-flog 5 ( word " extortion radius set to " extortion-radius T TNOW ) ] ] if random-float 1.0 < propensity-to-offend-addio-pizzo and count forbidden-shops > 5 [ let my-forbidden-shops turtle-set forbidden-shops ask forbidden-shops with [ addio-pizzo? ] [ set my-forbidden-shops other my-forbidden-shops ] ;; but-first remove-duplicates forbidden-shops set forbidden-shops turtle-set my-forbidden-shops ] end ;; extorters punish shops which have not paid pizzo; the shops know that they violated the PAY-EXTORTION-AS-EVERYBODY-DOES, other shops observe this ;; and that a shop complied with the DO-NOT-PAY-EXTORTION norm ;; the punishment is public, thus the offender's name is inserted into the criminal records to punish [ victim ] if state != "active" [ stop ] let punishment [ shop-wealth ] of victim * punishment-severity / 100 let this-extorter self let this-victim victim ask victim [ if count out-pay-link-neighbors > 1 [ get-rid-of-other-extorters ] let my-current-extorter one-of out-pay-link-neighbors set shop-wealth shop-wealth - punishment set volume-of-loss-this-month volume-of-loss-this-month + punishment util-flog 5 ( word "current wealth: " shop-wealth ", monthly income: " monthly-income ", old-wealth: " old-wealth " at " T TNOW " after punishment" ) set date-of-recent-punishment ticks set amount-of-recent-punishment amount-of-recent-punishment + punishment update-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" ask shops in-radius LOCAL [ update-observed-compliances "DO-NOT-PAY-EXTORTION"] ask shops in-radius LOCAL [ update-observed-violations "PAY-EXTORTION-AS-EVERYBODY-DOES" ] if any? police in-radius vision-range [ let officer one-of police in-radius vision-range ask officer [ start-prosecute this-extorter this-victim ] util-debug "punish: " officer this-extorter this-victim util-flog 5 ( word "police officer " officer " observed " this-extorter " punishing " this-victim " and starts prosecuting" ) ] change-entry myself victim i-punished-at TNOW change-amount myself victim i-punishment-amount punishment ] set wealth wealth + punishment ifelse is-extorter? self [ set criminal-records ( turtle-set criminal-records self ) ] [ util-flog 0 ( word "ERROR (punish): " self " is not an extorter!" ) ] end ;; for different reasons an extorter can become inactive (no money left, put to custody or jail, pentito) to become-inactive ask my-out-threaten-links [ die ] ask my-in-pay-links [ die ] end ;; an extorter decides to denounce colleagues (becomes a "pentito") to become-rueful let my-accomplices ( turtle-set in-reports-to-link-neighbors in-levies-tribute-from-link-neighbors ) if not any? my-accomplices [ stop ] ;; isolated extorters never become pentiti set criminal-records ( turtle-set criminal-records my-accomplices ) ask my-accomplices [ update-explicit-compliance-invocations "ABJURE-CRIME" 0 self message-id ] ask my-accomplices [ update-observed-violations "DO-NOT-BETRAY-COLLEAGUES" ] ;; now the pentito cuts all links to his neigbours in the family tree let my-boss one-of in-levies-tribute-from-link-neighbors let my-followers in-reports-to-link-neighbors ;; and gives up all current extortions ask my-in-pay-links [ die ] ask my-out-threaten-links [ die ] ask my-in-links [ die ] ask my-out-links [ die ] ask my-followers [ ask my-out-reports-to-links with [ other-end = myself ] [ die ] if my-boss != nobody [ create-reports-to-link-to my-boss [ set color 52 set shape "my-arc" ] create-levies-tribute-from-link-from my-boss [ set color 25 set shape "my-arc" ] ] ] if my-boss != nobody [ ask my-boss [ ask my-out-levies-tribute-from-links with [ other-end = myself ] [ die ] create-levies-tribute-from-links-to my-followers [ set color 25 set shape "my-arc" ] ] ] if not is-batch? [ output-print " " output-print ( list who " leaves family " my-family ", boss was " my-boss ) ifelse any? my-followers [ output-print ( list who "'s followers " [ who ] of my-followers " cut their links to " who ) ] [ output-print ( list who " had no followers" ) ] ifelse my-boss != nobody [ output-print ( list [ who ] of my-boss " cut its links to " who ) ] [ output-print ( list who " had no followers" ) ] ifelse any? my-followers and my-boss != nobody [ output-print ( list [ who ] of my-followers " created links to " [ who ] of my-boss ) output-print ( list [ who ] of my-boss " created links to " [ who ] of my-followers ) ] [ output-print ( list " no consequences" ) ] ] set state "pentito" become-inactive set color black set shape "bird" right 90 set my-family -1 end ;; an extorter joins a famliy when competitor turned out to be more powerful to subordinate-yourself-to [ boss ] let boss-family 0 set my-family family ask boss [ set boss-family family ] if role = "*" and my-family != [ my-family ] of boss [ create-reports-to-link-to boss [ set color 52 set shape "my-arc"] create-levies-tribute-from-link-from boss [ set color 25 set shape "my-arc" ] ifelse count in-reports-to-link-neighbors = 0 [ set role "-" ][ set role "+" ] ] end ;;;;;;;;;;;;;; ;; ;; Utilities ;; ;;;;;;;;;;;;;; ;; extorters from hierarchies, here is how they are displayed to report-sub-hierarchies [ indentation ] ifelse count in-reports-to-link-neighbors = 0 [ ] [ let followers in-reports-to-link-neighbors if not is-batch? [ output-type indentation output-print [ who ] of followers ] set indentation word indentation "..." set this-family-depth this-family-depth + 1 ask followers [ if not is-batch? [ output-type indentation output-type who output-print role ] report-sub-hierarchies indentation ] ] end ;; two recursive functions organising the redistribution of resources within a family to collect-from-subordinates if state != "active" [ stop ] let accrual 0 let relevant-subordinates in-reports-to-link-neighbors ;; with [ state != "pentito" ] let n-of-subordinates count relevant-subordinates if n-of-subordinates = 0 [ stop ] ask relevant-subordinates [ collect-from-subordinates if wealth > 0 [ let payment wealth * solidarity set wealth wealth - payment set accrual accrual + payment ] ] set wealth wealth + accrual end to distribute-to-subordinates if state != "active" [ stop ] let accrual 0 let relevant-subordinates in-reports-to-link-neighbors with [ state != "pentito" ] let n-of-subordinates count relevant-subordinates if n-of-subordinates = 0 [ stop ] if n-of-subordinates > 0 [ let my-wealth wealth if my-wealth > 0 [ ask relevant-subordinates [ distribute-to-subordinates let payment my-wealth * solidarity / n-of-subordinates set wealth wealth + payment set accrual accrual - payment if state = "penniless" [ ifelse wealth > 0 [ set state "active" util-flog 5 ( word "reactivated after family paid " payment ", wealth is " wealth " at " T TNOW ) ] [ util-flog 5 ( word "not yet reactivated after family paid " payment ", wealth is " wealth " at " T TNOW ) ] ] ] ] ] set wealth wealth + accrual if wealth <= 0 [ set state "penniless" ] end ;; this procedure serves two purposes: to document the family hierarchy and to redistribute money between the members of each family to report-hierarchies let top-positions extorters with [ ( count out-reports-to-link-neighbors = 0 ) and ( count in-reports-to-link-neighbors > 0 ) ] if not is-batch? [ output-print word "Current families at " time:show time:plus startdate ticks "hours" "yyyy-MM-dd HH:mm" output-type "top-positions: " ifelse any? top-positions [ output-print [ who ] of top-positions ] [ output-print "no top positions" ] ] let indentation "..." set this-family-depth 0 set max-family-depth 0 set size-of-largest-family 0 ask top-positions [ let accrual 0 ask in-reports-to-link-neighbors [ collect-from-subordinates let payment wealth * solidarity set wealth wealth - payment set accrual accrual + payment ] set wealth wealth + accrual ] ask top-positions [ let accrual 0 let n-of-subordinates count in-reports-to-link-neighbors if n-of-subordinates > 0 [ let my-wealth wealth ask in-reports-to-link-neighbors [ distribute-to-subordinates let payment my-wealth * solidarity / n-of-subordinates set wealth wealth + payment set accrual accrual - payment ] set wealth wealth + accrual ] ] ask top-positions [ if not is-batch? [ output-type indentation output-type who output-print role ] report-sub-hierarchies indentation ] ask extorters [ ifelse role = "*" [ set size 2 set n-of-family-members count extorters with [ family = [ my-family ] of myself ] if size-of-largest-family < n-of-family-members [ set size-of-largest-family n-of-family-members ] ] [ set size 1 ] if count out-reports-to-link-neighbors > 1 [ util-flog 0 ( word "ERROR (report-hierarchies): in " [ who ] of in-reports-to-link-neighbors " in family " family ) util-flog 0 ( word "ERROR (report-hierarchies): out " [ who ] of out-reports-to-link-neighbors " in family " family ) set ERROR-OCCURRED? true ] ] if this-family-depth > max-family-depth [ set max-family-depth this-family-depth ] end ;; reports to which family an extorter belongs to-report family let result -1 if count out-reports-to-link-neighbors > 1 [ set ERROR-OCCURRED? true util-flog 0 ( list "ERROR: family " [ who ] of out-reports-to-link-neighbors ) ask out-reports-to-link-neighbors [ util-flog 0 ( list "ERROR: family " [ who ] of out-reports-to-link-neighbors ) ] report result ] ifelse count out-reports-to-link-neighbors = 0 [ set result who ] [ let boss one-of out-reports-to-link-neighbors ask boss [ set result family ] ] report result end to prepare-output ifelse count shops with [ not addio-pizzo? and not bankrupt?] > 0 [ set m-ass-non-a-p mean ( [ shop-wealth ] of shops with [ not addio-pizzo? and not bankrupt? ] ) ] [ set m-ass-non-a-p 0 ] ifelse count shops with [ addio-pizzo? and not bankrupt? ] > 0 [ set m-ass-a-p-shops mean ( [ shop-wealth ] of shops with [ addio-pizzo? and not bankrupt? ] ) ] [ set m-ass-a-p-shops 0 ] if time-when-addio-pizzo-takes-over < 0 [ if m-ass-a-p-shops > m-ass-non-a-p [ set time-when-addio-pizzo-takes-over ticks ] ] ifelse count extorters with [ state = "active" ] > 0 [ set m-ass-ext-act mean [ wealth ] of extorters with [ state = "active" ] ] [ set m-ass-ext-act 0 ] ifelse count extorters with [ state = "in jail" ] > 0 [ set m-ass-ext-jail mean [ wealth ] of extorters with [ state = "in jail" ] ] [ set m-ass-ext-jail 0 ] ifelse count extorters with [ state = "penniless" ] > 0 [ set m-ass-ext-inact mean [ wealth ] of extorters with [ state = "penniless" ] ] [ set m-ass-ext-inact 0 ] ;; the following counts take only the past length-moving-average (or less) periods into account set length-moving-average 1440 let relevant-extortions filter [ time:difference-between ( item 2 ? ) no-extortion-after "hours" < length-moving-average ] but-first extortion-database set n-extortions length relevant-extortions util-flog 5 ( word "at " TNOW " " n-extortions " before " no-extortion-after ) set n-of-undetected-cases length filter [ item i-denounced-at ? = NULL and item i-prosecution-start ? = NULL and item i-punished-at ? = NULL ] relevant-extortions set n-of-detected-cases n-extortions - n-of-undetected-cases set n-of-denounced-extortions length filter [ item i-denounced-at ? != NULL ] relevant-extortions set n-of-prosecuted-cases length filter [ item i-prosecution-start ? != NULL ] relevant-extortions set n-of-successful-extortions length filter [ item i-paid-at ? != NULL and item i-amount-paid ? > 0 ] relevant-extortions set n-of-successful-detected-extortions length filter [ item i-paid-at ? != NULL and item i-amount-paid ? > 0 and ( item i-denounced-at ? != NULL or item i-prosecution-start ? != NULL or item i-punished-at ? != NULL ) ] relevant-extortions set n-of-cases-with-punishment length filter [ item i-punished-at ? != NULL and item i-punishment-amount ? > 0 ] relevant-extortions set n-of-cases-with-arrest length filter [ item i-arrested-at ? != NULL ] relevant-extortions set n-of-cases-with-conviction length filter [ item i-convicted-at ? != NULL and item i-sentence ? > 0 ] relevant-extortions if n-extortions > 0 [ set percentage-of-undetected-cases n-of-undetected-cases / n-extortions set percentage-of-unreported-cases length filter [ item i-denounced-at ? = NULL ] relevant-extortions / n-extortions set percentage-of-denounced-extortions n-of-denounced-extortions / n-extortions set percentage-of-completed-extortions n-of-successful-extortions / n-extortions set percentage-of-cases-with-arrest n-of-cases-with-arrest / n-extortions set percentage-of-cases-with-punishment n-of-cases-with-punishment / n-extortions set percentage-of-cases-with-conviction n-of-cases-with-conviction / n-extortions ] if n-of-detected-cases > 0 [ set denunciation-rate n-of-denounced-extortions / n-of-detected-cases set prosecution-rate n-of-prosecuted-cases / n-of-detected-cases set success-rate n-of-successful-detected-extortions / n-of-detected-cases set arrest-rate n-of-cases-with-arrest / n-of-detected-cases set conviction-rate n-of-cases-with-conviction / n-of-detected-cases ] set percentage-of-critical-consumers mean [ my-addio-pizzo-buy-propensity ] of public file-open history-name file-type behaviorspace-run-number file-type csv-separator file-type run-type file-type csv-separator file-type run-group file-type csv-separator file-type intervention-type file-type csv-separator file-type round ( ticks / 24 ) file-type csv-separator file-type current-seed file-type csv-separator file-type rectify-date file-type csv-separator file-type seconds-since-startdate file-type csv-separator file-type BACKGROUND file-type csv-separator file-type NDW file-type csv-separator file-type LOCAL file-type csv-separator file-type DISCOUNT file-type csv-separator file-type percentage-of-undetected-cases file-type csv-separator file-type percentage-of-unreported-cases file-type csv-separator file-type percentage-of-denounced-extortions file-type csv-separator file-type percentage-of-completed-extortions file-type csv-separator file-type percentage-of-cases-with-arrest file-type csv-separator file-type percentage-of-cases-with-punishment file-type csv-separator file-type denunciation-rate file-type csv-separator file-type prosecution-rate file-type csv-separator file-type success-rate file-type csv-separator file-type arrest-rate file-type csv-separator file-type conviction-rate file-type csv-separator file-print percentage-of-critical-consumers file-flush time-schedule-event "observer" task [ report-hierarchies prepare-output update-plots ] "report-hierarchies prepare-output update-plots" ( time:plus TNOW 1 "day" ) end to prepare-final-output let all-n n-values length all-norms [ 0 ] let all-sum all-n let all-sqsum all-n ask ( turtle-set extorters public police shops ) [ foreach all-norms [ let this-norm ? let np 0 if member? this-norm my-norms [ set np position this-norm all-norms let old-value item np all-n set all-n replace-item np all-n ( 1 + old-value ) set old-value item np all-sum let my-np position this-norm my-norms let new-value item my-np my-norm-saliences set all-sum replace-item np all-sum ( new-value + old-value ) set old-value item np all-sqsum set all-sqsum replace-item np all-sqsum ( new-value * new-value + old-value ) ] ] ] foreach all-norms [ let np position ? all-norms let this-n item np all-n if this-n > 0 [ set all-means replace-item np all-means ( ( item np all-sum ) / this-n ) set all-sds replace-item np all-sds ( ( item np all-sqsum ) / this-n - ( item np all-means ) * ( item np all-means ) ) ] ] ifelse count shops with [ addio-pizzo? and not bankrupt? ] > 0 [ set mean-shop-wealth-addio-pizzo mean [ shop-wealth ] of shops with [ addio-pizzo? and not bankrupt? ] ] [ set mean-shop-wealth-addio-pizzo -1 ] ifelse count shops with [ not addio-pizzo? and not bankrupt? ] > 0 [ set mean-shop-wealth-non-addio-pizzo mean [ shop-wealth ] of shops with [ not addio-pizzo? and not bankrupt? ] ] [ set mean-shop-wealth-non-addio-pizzo -1 ] set n-families count extorters with [ role = "*" and count out-levies-tribute-from-link-neighbors > 0 ] set n-shops-non-addio-pizzo count shops with [ not addio-pizzo? and not bankrupt? ] set n-shops-addio-pizzo count shops with [ addio-pizzo? and not bankrupt? ] set n-shops-still-paying count shops with [ count my-out-pay-links > 0 ] let count-shopping ( count-addio-pizzo-shopping + count-non-addio-pizzo-shopping ) ifelse count-shopping > 0 [ set addio-pizzo-shopping-percentage count-addio-pizzo-shopping / count-shopping ] [ set addio-pizzo-shopping-percentage 0 ] if export-interface? and behaviorspace-run-number = 0 [ export-interface interface-filename util-flog 5 word "interface exported to " interface-filename ] file-close if not is-batch? [ file-open database-name foreach extortion-database [ file-type item 0 ? ;; extorter file-type csv-separator file-type item 1 ? ;; victim file-type csv-separator file-type item 2 ? ;; first attempt file-type csv-separator file-type item 3 ? ;; denounced-at file-type csv-separator file-type item 4 ? ;; paid-at file-type csv-separator file-type item 5 ? ;; prosecution-start file-type csv-separator file-type item 6 ? ;; amount paid file-type csv-separator file-type item 7 ? ;; punished-at file-type csv-separator file-type item 8 ? ;; punishment-amount file-type csv-separator file-type item 9 ? ;; arrested-at file-type csv-separator file-type item 10 ? ;; convicted-at file-type csv-separator file-print item 11 ? ;; years-in-jail ] file-close util-flog 0 word "extortion database exported to " database-name ] end to-report random-float-in-range [ low high ] report low + random-float ( high - low ) end to-report sqr [ x ] report x * x end to-report rectify-day let date-string date-and-time let colon position ":" date-string set date-string replace-item colon date-string "-" set colon position ":" date-string set date-string replace-item colon date-string "-" set colon position "." date-string set date-string replace-item colon date-string "-" let year substring date-string 23 27 let month substring date-string 19 22 if month = "Okt" [ set month "Oct" ] if month = "Dez" [ set month "Dec" ] if month = "Mär" [ set month "Mar" ] if month = "Mai" [ set month "May" ] let day substring date-string 16 18 let AMPM substring date-string 13 15 let hour substring date-string 0 2 let minsec substring date-string 2 12 let month-number ( 1 + ( position month ( list "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" ) ) ) ifelse month-number < 10 [ set month ( word "0" month-number ) ] [ set month ( word month-number ) ] let num-hour read-from-string hour if AMPM = "PM" [ set hour ( word ( num-hour + 12 ) ) ] set date-string ( word year "-" month "-" day ) report date-string end to-report rectify-date let date-string date-and-time let year substring date-string 23 27 let month substring date-string 19 22 if month = "Okt" [ set month "Oct" ] if month = "Dez" [ set month "Dec" ] if month = "Mär" [ set month "Mar" ] if month = "Mai" [ set month "May" ] let day substring date-string 16 18 let AMPM substring date-string 13 15 let hour substring date-string 0 2 let mmin substring date-string 3 5 let sec substring date-string 6 12 let month-number ( 1 + ( position month ( list "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" ) ) ) ifelse month-number < 10 [ set month ( word "0" month-number ) ] [ set month ( word month-number ) ] let num-hour read-from-string hour let num-min read-from-string mmin let num-sec read-from-string sec let time-of-day ( num-sec + 60 * num-min + 3600 * num-hour ) / 3600 if AMPM = "PM" and time-of-day < 12 [ set hour ( word ( num-hour + 12 ) ) ] set date-string ( word year "-" month "-" day "-" hour "-" mmin "-" sec ) report date-string end to-report seconds-since-startdate let start-day substring real-startdate 16 18 let AMPM substring real-startdate 13 15 let hour substring real-startdate 0 2 let mmin substring real-startdate 3 5 let sec substring real-startdate 6 12 let num-hour read-from-string hour let num-min read-from-string mmin let num-sec read-from-string sec let start-time ( num-sec + 60 * num-min + 3600 * num-hour ) / 3600 let current-time date-and-time set AMPM substring current-time 13 15 set hour substring current-time 0 2 set mmin substring current-time 3 5 set sec substring current-time 6 12 set num-hour read-from-string hour set num-min read-from-string mmin set num-sec read-from-string sec let current-seconds ( num-sec + 60 * num-min + 3600 * num-hour ) / 3600 if start-day < substring current-time 16 18 [ set current-seconds current-seconds + 24 ] report ( ( current-seconds - start-time ) * 3600 ) end to-report entry-found [ an-extorter victim ] let result list 0 0 let possible-entries sort-by [ item 3 ?1 > item 3 ?2 ] filter [ item 0 ? = an-extorter and item 1 ? = victim ] extortion-database if not empty? possible-entries [ let first-attempt item 2 first possible-entries let current-attempt item 3 first possible-entries set result list first-attempt current-attempt ] report result end to add-entry [ an-extorter victim first-attempt denounced-at paid-at prosecution-start amount-paid punished-at punishment-amount arrested-at convicted-at years-in-jail ] set no-extortion-after T TNOW let new-entry ( list an-extorter victim T first-attempt T denounced-at T paid-at T prosecution-start amount-paid T punished-at punishment-amount T arrested-at T convicted-at years-in-jail ) set extortion-database lput new-entry extortion-database end to change-entry [ an-extorter a-victim key a-logotime ] let applicable-entries filter [ item 0 ? = an-extorter and item 1 ? = a-victim ] extortion-database ifelse length applicable-entries > 0 [ let entry-to-replace first sort-by [ time:is-after ( item i-first-attempt ?1 ) ( item i-first-attempt ?2 ) ] applicable-entries let entry-key position entry-to-replace extortion-database set entry-to-replace replace-item key entry-to-replace T a-logotime set extortion-database replace-item entry-key extortion-database entry-to-replace ] [ util-flog 0 ( word "ERROR: " an-extorter " " a-victim " " key " " a-logotime ) ] end to change-amount [ an-extorter a-victim key an-amount ] let applicable-entries filter [ item 0 ? = an-extorter and item 1 ? = a-victim ] extortion-database ifelse length applicable-entries > 0 [ let entry-to-replace first sort-by [ time:is-after ( item i-first-attempt ?1 ) ( item i-first-attempt ?2 ) ] applicable-entries let entry-key position entry-to-replace extortion-database set entry-to-replace replace-item key entry-to-replace an-amount set extortion-database replace-item entry-key extortion-database entry-to-replace ] [ util-flog 0 ( word "ERROR: " an-extorter " " a-victim " " key " " an-amount ) util-flog 5 extortion-database ] end to-report TNOW report time:plus startdate ticks "hours" end to-report T [ a-logotime ] ifelse a-logotime = NULL or a-logotime = 0 [ report a-logotime ] [ report time:show a-logotime "yyyy-MM-dd HH:mm:ss" ] end to util-flog [ level something ] file-open logfile-name if level < log-level [ file-show ( word "; " level "; " something ) ] file-flush end to util-debug [ a-procedure an-officer an-extorter a-shop ] if not is-police-officer? an-officer [ util-flog 0 ( word "ERROR (util-debug): " a-procedure an-officer an-extorter a-shop ) ] if not is-extorter? an-extorter [ util-flog 0 ( word a-procedure an-officer an-extorter a-shop ) ] if not is-shop? a-shop [ util-flog 0 ( word a-procedure an-officer an-extorter a-shop ) ] if an-extorter = nobody [ show "no extorter" ] if a-shop = nobody [ show "no shop" ] end to util-intervention ifelse intervention-type = 0 [ let npu 0 let nsh 0 let npo 0 let nex 0 if public-reset [ set npu 1 ] if shop-reset [ set nsh 2 ] if police-reset [ set npo 4 ] if extorter-reset [ set nex 8 ] let it npu + nsh + npo + nex let itlist ( list 0 1 2 5 3 6 8 11 4 7 9 13 10 12 14 15 ) set intervention-type item it itlist ] [ let it intervention-type set public-reset false set shop-reset false set police-reset false set extorter-reset false if it = 1 or it = 5 or it = 6 or it = 7 or it = 11 or it = 12 or it = 13 or it = 15 [ set public-reset true ] if it = 2 or it = 5 or it = 8 or it = 9 or it = 11 or it = 13 or it = 14 or it = 15 [ set shop-reset true ] if it = 3 or it = 6 or it = 8 or it = 10 or it = 11 or it = 12 or it = 14 or it = 15 [ set police-reset true ] if it = 4 or it = 7 or it = 9 or it = 10 or it = 12 or it = 13 or it = 14 or it = 15 [ set extorter-reset true ] ] end to util-standard-settings set sensitivity-batch? false set intervention-batch? false set special-batch? false end to util-batch-settings set max-months 24 set constant-random-seed? false if member? "intervention" behaviorspace-experiment-name [ set intervention-batch? true set sensitivity-batch? false set special-batch? false set intervention-month 12 ] if member? "sensitivity" behaviorspace-experiment-name [ set intervention-batch? false set sensitivity-batch? true set special-batch? false set bgmin (-20) set bgmax 20 set intervention-month 0 set intervention-type 0 ] if member? "special" behaviorspace-experiment-name [ set intervention-batch? false set sensitivity-batch? false set special-batch? true set bgmin (-20) set bgmax 20 set intervention-month 0 set intervention-type 0 ] end @#$#@#$#@ GRAPHICS-WINDOW 375 10 865 521 -1 -1 8.0 1 8 1 1 1 0 0 0 1 0 59 0 59 0 0 1 ticks 30.0 BUTTON 105 10 182 46 NIL populate NIL 1 T OBSERVER NIL NIL NIL NIL 0 SLIDER 5 70 185 103 initial-shops initial-shops 0 500 100 50 1 NIL HORIZONTAL SWITCH 5 700 170 733 constant-random-seed? constant-random-seed? 1 1 -1000 TEXTBOX 20 550 80 568 World 11 0.0 1 SLIDER 5 265 160 298 extortion-level-low extortion-level-low 0 extortion-level-high 10 2.5 1 % HORIZONTAL TEXTBOX 20 55 170 73 Shops' parameters: 11 0.0 1 SLIDER 205 70 370 103 initial-wealth-min initial-wealth-min 0 60000 60000 1000 1 NIL HORIZONTAL SLIDER 205 105 370 138 initial-wealth-max initial-wealth-max 0 120000 60000 1000 1 NIL HORIZONTAL TEXTBOX 25 415 175 433 Police's parameters: 11 0.0 1 SLIDER 5 435 180 468 initial-police initial-police 0 100 10 5 1 NIL HORIZONTAL PLOT 1585 565 1860 685 Mean assets of extorters NIL NIL 0.0 1.0 0.0 2000.0 true true "" "" PENS "active" 1.0 0 -955883 true "" "plotxy ( ticks / 730.5 ) m-ass-ext-act" "in jail" 1.0 0 -13210332 true "" "plotxy ( ticks / 730.5 ) m-ass-ext-jail" "inactive" 1.0 0 -16777216 true "" "plotxy ( ticks / 730.5 ) m-ass-ext-inact" PLOT 1585 685 1860 815 Mean assets of targets NIL NIL 0.0 1.0 0.0 10.0 true true "" "" PENS "pizzo payers" 1.0 0 -13345367 true "" "plotxy ( ticks / 730.5 ) m-ass-non-a-p" "addio-pizzo" 1.0 0 -2674135 true "" "plotxy ( ticks / 730.5 ) m-ass-a-p-shops" SLIDER 5 195 160 228 initial-extorters initial-extorters 0 300 50 10 1 NIL HORIZONTAL SLIDER 170 300 365 333 punishment-severity-high punishment-severity-high punishment-severity-low 80 30 10 1 % HORIZONTAL SLIDER 5 300 160 333 extortion-level-high extortion-level-high extortion-level-low 80 10 2.5 1 % HORIZONTAL SLIDER 170 265 365 298 punishment-severity-low punishment-severity-low 0 punishment-severity-high 25 5 1 % HORIZONTAL SLIDER 170 195 365 228 initial-extortion-radius initial-extortion-radius 0 10 5 1 1 NIL HORIZONTAL SLIDER 170 230 365 263 extortion-radius-extension extortion-radius-extension 1 1.2 1.093 0.01 1 NIL HORIZONTAL SLIDER 5 230 160 263 consumption-per-period consumption-per-period 0 2000 120 60 1 NIL HORIZONTAL TEXTBOX 10 180 160 198 Extorters' parameters 11 0.0 1 SLIDER 5 565 175 598 initial-villages initial-villages 5 50 30 5 1 NIL HORIZONTAL PLOT 1380 540 1585 665 Number of extorters NIL NIL 0.0 1.0 0.0 10.0 true true "" "" PENS "inactive" 1.0 0 -4539718 true "" "plotxy ( ticks / 730.5 ) count extorters with [ state = \"penniless\" ]" "in jail" 1.0 0 -13210332 true "" "plotxy ( ticks / 730.5 ) count extorters with [ state = \"in jail\" ]" "active" 1.0 0 -2674135 true "" "plotxy ( ticks / 730.5 ) count extorters with [ state = \"active\" ]" "pentito" 1.0 0 -11221820 true "" "plotxy ( ticks / 730.5 ) count extorters with [ state = \"pentito\" ]" "in custody" 1.0 0 -6565750 true "" "plotxy ( ticks / 730.5 ) count extorters with [ state = \"arrested\" ]" SLIDER 185 435 365 468 initial-public initial-public 0 4800 800 200 1 NIL HORIZONTAL TEXTBOX 190 415 340 433 Consumers' parameters 11 0.0 1 SWITCH 5 770 170 803 show-extortion-links? show-extortion-links? 0 1 -1000 OUTPUT 1125 420 1380 815 8 PLOT 1380 665 1585 815 Families NIL NIL 0.0 1.0 0.0 10.0 true true "" "" PENS "number" 1.0 0 -16777216 true "" "plotxy ( ticks / 730.5 ) count extorters with [ role = \"*\" and count out-levies-tribute-from-link-neighbors > 0 ]" "max depth" 1.0 0 -13840069 true "" "plotxy ( ticks / 730.5 ) max-family-depth" "max size" 1.0 0 -955883 true "" "plotxy ( ticks / 730.5 ) size-of-largest-family" "isolated" 1.0 0 -11221820 true "" "plotxy ( ticks / 730.5 ) count extorters with [ ( count my-in-levies-tribute-from-links = 0 ) and state = \"active\" ]" PLOT 1585 420 1860 565 Current distribution of assets NIL NIL 0.0 1.0 0.0 10.0 true true "" "" PENS "addio-pizzo" 1.0 0 -2674135 true "" "plotxy ( ticks / 730.5 ) sum [ shop-wealth ] of shops with [ addio-pizzo? and not bankrupt? ]" "pizzo payers" 1.0 0 -13345367 true "" "plotxy ( ticks / 730.5 ) sum [ shop-wealth ] of shops with [ not addio-pizzo? and not bankrupt? ]" "active extorters" 1.0 0 -955883 true "" "plotxy ( ticks / 730.5 ) sum [ wealth ] of extorters with [ state = \"active\" ]" "extorters in custody" 1.0 0 -14835848 true "" "plotxy ( ticks / 730.5 ) sum [ wealth ] of extorters with [ state = \"arrested\" ]" "confiscated" 1.0 0 -16777216 true "" "plotxy ( ticks / 730.5 ) confiscated" "private" 1.0 0 -13840069 true "" "plotxy ( ticks / 730.5 ) sum [ private-wealth ] of public" "pentiti" 1.0 0 -11221820 true "" "plotxy ( ticks / 730.5 ) sum [ wealth ] of extorters with [ state = \"pentito\" ]" MONITOR 375 540 440 585 remaining count shops with [ not bankrupt? and addio-pizzo? ] 17 1 11 MONITOR 445 540 512 585 remaining count shops with [ not addio-pizzo? and not bankrupt? ] 17 1 11 MONITOR 375 630 440 675 failed count shops with [ addio-pizzo? and bankrupt? ] 17 1 11 MONITOR 445 630 512 675 failed count shops with [ not addio-pizzo? and bankrupt? ] 17 1 11 MONITOR 520 540 570 585 active count extorters with [ state = \"active\" ] 17 1 11 MONITOR 730 540 780 585 in jail count extorters with [ state = \"in jail\" ] 17 1 11 MONITOR 780 540 830 585 retired count extorters with [ state = \"penniless\" ] 17 1 11 MONITOR 570 540 660 585 previously in jail count extorters with [ was-in-jail? and state = \"active\" ] 17 1 11 SLIDER 170 335 365 368 propensity-to-offend-addio-pizzo propensity-to-offend-addio-pizzo 0 1 0 0.1 1 NIL HORIZONTAL MONITOR 375 585 440 630 paying count shops with [ addio-pizzo? and count my-out-pay-links > 0 ] 17 1 11 MONITOR 445 585 512 630 paying count shops with [ not addio-pizzo? and count my-out-pay-links > 0 ] 17 1 11 MONITOR 375 675 455 720 total wealth sum [ wealth ] of extorters + sum [ shop-wealth ] of shops + confiscated + total-money + sum [ private-wealth ] of public 2 1 11 MONITOR 455 675 552 720 wealth of shops sum [ shop-wealth ] of shops 2 1 11 MONITOR 550 675 630 720 of extorters sum [ wealth ] of extorters 2 1 11 MONITOR 630 675 700 720 confiscated confiscated 2 1 11 SLIDER 5 105 185 138 fixed-cost-per-period fixed-cost-per-period 0 500 200 100 1 NIL HORIZONTAL PLOT 1380 420 1585 540 Number of shops NIL NIL 0.0 1.0 0.0 10.0 true true "" "" PENS "pizzo-payers" 1.0 0 -13345367 true "" "plotxy ( ticks / 730.5 ) count shops with [ not addio-pizzo? and not bankrupt? ]" "addio-pizzo" 1.0 0 -2674135 true "" "plotxy ( ticks / 730.5 ) count shops with [ addio-pizzo? and not bankrupt? ]" "failed shops" 1.0 0 -7500403 true "" "plotxy ( ticks / 730.5 ) count shops with [ bankrupt? ]" SLIDER 185 470 365 503 initial-wealth initial-wealth 0 1000 500 50 1 NIL HORIZONTAL SLIDER 5 140 187 173 variable-cost-coefficient variable-cost-coefficient 0 1 0.7 0.1 1 NIL HORIZONTAL MONITOR 700 675 785 720 private sum [ private-wealth ] of public 2 1 11 SLIDER 185 505 365 538 consumption-rate-low consumption-rate-low 0.0 1 0.9 0.1 1 NIL HORIZONTAL SLIDER 185 540 365 573 consumption-rate-high consumption-rate-high 0.0 1 1 0.1 1 NIL HORIZONTAL SWITCH 175 700 340 733 export-interface? export-interface? 1 1 -1000 SLIDER 185 600 357 633 DISCOUNT DISCOUNT 0 1 0.88 0.1 1 NIL HORIZONTAL SLIDER 5 600 177 633 LOCAL LOCAL 0 20 4.7 0.25 1 NIL HORIZONTAL SLIDER 185 635 357 668 NDW NDW 0 1 0.525 0.05 1 NIL HORIZONTAL MONITOR 890 770 1010 815 Messages exchanged message-id 17 1 11 PLOT 1105 60 1265 180 DO NOT PAY EXTORTION NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05\nset-plot-y-range 0 initial-shops" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 2 my-norm-saliences ] of shops" PLOT 945 60 1105 180 DENOUNCE NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 0.05 1 -16777216 true "" "histogram [ item 0 my-norm-saliences ] of shops" MONITOR 1010 770 1125 815 n-sal min-sal max-sal ( list n-sal precision min-sal 3 precision max-sal 3 ) 17 1 11 PLOT 1265 60 1425 180 DO NOT SHOP AT EXTORTION PAYER NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -1 true "" "histogram [ item 0 my-norm-saliences ] of public" PLOT 1105 180 1265 300 PAY EXTORTION AS EVERYBODY DOES NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 3 my-norm-saliences ] of shops" PLOT 1585 60 1745 180 TRY HARD TO IMPRISON NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 1 my-norm-saliences ] of police" SLIDER 5 470 177 503 vision-range vision-range 0 84 51 4 1 NIL HORIZONTAL SLIDER 5 505 177 538 conviction-probability conviction-probability 0 1 0.61 0.05 1 NIL HORIZONTAL SLIDER 5 335 160 368 solidarity solidarity 0 1 0.5 0.05 1 NIL HORIZONTAL SLIDER 5 635 177 668 BACKGROUND BACKGROUND -100 100 -12 0.1 1 NIL HORIZONTAL PLOT 945 300 1105 420 denunciation NIL NIL 0.0 1.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 0.05 1 -16777216 true "" "histogram [ my-denunciation-propensity ] of shops" PLOT 1105 300 1265 420 pay extortion NIL NIL 0.0 1.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 1 -16777216 true "" "histogram [ my-pay-extortion-propensity ] of shops" PLOT 1585 300 1745 420 prosecute NIL NIL 0.0 1.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 1 -16777216 true "" "histogram [ my-prosecution-propensity ] of police" PLOT 1265 300 1425 420 buy from addio-pizzo NIL NIL 0.0 1.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 1 -1 true "" "histogram [ my-addio-pizzo-buy-propensity ] of public" SLIDER 170 370 365 403 benefit-for-victims benefit-for-victims 0 200 126.5 5 1 % HORIZONTAL PLOT 945 180 1105 300 DO NOT DENOUNCE NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05\nset-plot-y-range 0 initial-shops" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 1 my-norm-saliences ] of shops" SLIDER 205 140 370 173 hide-denounce-propensity hide-denounce-propensity 0 1 0.0705 0.05 1 NIL HORIZONTAL TEXTBOX 990 10 1285 28 Action related saliences and propensities 11 0.0 1 TEXTBOX 970 40 1120 58 denounce 11 0.0 1 TEXTBOX 1120 40 1270 58 pay extortion 11 0.0 1 TEXTBOX 1280 40 1430 58 select addio-pizzo shop 11 0.0 1 TEXTBOX 1645 40 1795 58 prosecute 11 0.0 1 TEXTBOX 885 100 925 141 salience\ncivic \nnorm 11 0.0 1 TEXTBOX 885 225 945 266 salience\ntraditional \nnorm 11 0.0 1 TEXTBOX 885 335 940 371 action \npropensity 11 0.0 1 PLOT 1425 60 1585 180 ABJURE CRIME NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -1 true "" "histogram [ item 1 my-norm-saliences ] of extorters" TEXTBOX 1440 40 1590 58 become pentito 11 0.0 1 PLOT 1425 180 1585 300 DO NOT BETRAY NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -1 true "" "histogram [ item 0 my-norm-saliences ] of extorters" PLOT 1425 300 1585 420 become pentito NIL NIL 0.0 1.0 0.0 10.0 true false "" "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" PENS "default" 1.0 0 -1 true "" "histogram [ my-ruefulness ] of extorters" PLOT 1585 180 1745 300 ANXIETY IS JUSTIFIED NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 0 my-norm-saliences ] of police" PLOT 1265 180 1425 300 BUY FROM DENOUNCING ENTREPRENEUR NIL NIL 0.0 10.0 0.0 10.0 true false "set-plot-pen-mode 1\nset-plot-x-range 0.0 1.05\nset-plot-pen-color black\nset-plot-pen-interval 0.05" "" PENS "default" 1.0 0 -16777216 true "" "histogram [ item 1 my-norm-saliences ] of public" BUTTON 190 10 275 45 NIL go-eventwise NIL 1 T OBSERVER NIL NIL NIL NIL 0 SLIDER 370 745 545 778 intervention-month intervention-month 0 60 0 6 1 NIL HORIZONTAL MONITOR 1750 10 1855 55 Time time:show time:plus startdate ticks \"hours\" \"yyyy-MM-dd HH:mm\" 17 1 11 MONITOR 695 605 762 650 successful length filter [ item i-paid-at ? != NULL and item i-amount-paid ? > 0 ] but-first extortion-database 17 1 11 MONITOR 785 675 875 720 private mean mean [ private-wealth ] of public 2 1 11 SLIDER 5 735 170 768 log-level log-level -2 5 -5 1 1 NIL HORIZONTAL MONITOR 1750 55 1855 100 NIL no-extortion-after 17 1 11 TEXTBOX 375 525 440 543 addio-pizzo 11 0.0 1 TEXTBOX 445 525 505 543 other shops 11 0.0 1 TEXTBOX 530 525 580 543 extorters 11 0.0 1 MONITOR 665 540 730 585 in custody count extorters with [ state = \"arrested\" ] 17 1 11 TEXTBOX 520 590 590 608 extortions 11 0.0 1 MONITOR 520 605 570 650 all length extortion-database - 1 17 1 11 MONITOR 570 605 627 650 dark length filter [ item i-denounced-at ? = NULL and item i-paid-at ? != NULL and item i-punished-at ? = NULL and item i-prosecution-start ? = NULL ] but-first extortion-database 17 1 11 MONITOR 625 605 697 650 denounced length filter [ item i-denounced-at ? != NULL] but-first extortion-database 17 1 11 MONITOR 760 605 817 650 arrested length filter [ item i-arrested-at ? != NULL ] but-first extortion-database 17 1 11 MONITOR 815 605 877 650 convicted length filter [ item i-convicted-at ? != NULL and item i-sentence ? > 0 ] but-first extortion-database 17 1 11 MONITOR 830 540 887 585 pentito count extorters with [ state = \"pentito\" ] 17 1 11 TEXTBOX 10 675 80 693 Run controls 11 0.0 1 MONITOR 890 725 1010 770 pending events time:size-of-schedule 17 1 11 PLOT 890 420 1125 570 Extortion % detected NIL NIL 0.0 1.0 0.0 1.0 true true "" "" PENS "denounced" 1.0 0 -11221820 true "" "plotxy ( ticks / 730.5 ) denunciation-rate" "prosecuted" 1.0 0 -10899396 true "" "plotxy ( ticks / 730.5 ) prosecution-rate" "arrested" 1.0 0 -955883 true "" "plotxy ( ticks / 730.5 ) arrest-rate" "convicted" 1.0 0 -2674135 true "" "plotxy ( ticks / 730.5 ) conviction-rate" "successful" 1.0 0 -8630108 true "" "plotxy ( ticks / 730.5 ) success-rate" SLIDER 5 370 160 403 escape-chance escape-chance 0 1 0.40777 0.05 1 NIL HORIZONTAL CHOOSER 175 770 313 815 csv-separator csv-separator "," ";" 1 SLIDER 370 780 547 813 intervention-type intervention-type 0 15 0 1 1 NIL HORIZONTAL SLIDER 175 735 340 768 max-months max-months 0 60 24 6 1 NIL HORIZONTAL SWITCH 550 745 667 778 shop-reset shop-reset 1 1 -1000 SWITCH 670 745 790 778 public-reset public-reset 1 1 -1000 SWITCH 550 780 667 813 police-reset police-reset 1 1 -1000 SWITCH 670 780 790 813 extorter-reset extorter-reset 1 1 -1000 TEXTBOX 370 725 520 743 Intervention controls\n 11 0.0 1 PLOT 890 570 1125 725 Extortions % all NIL NIL 0.0 1.0 0.0 1.0 true true "" "" PENS "dark" 1.0 0 -16777216 true "" "plotxy ( ticks / 730.5 ) percentage-of-undetected-cases" "successful" 1.0 0 -8630108 true "" "plotxy ( ticks / 730.5 ) percentage-of-completed-extortions" MONITOR 1010 725 1125 770 all events event-counter 0 1 11 BUTTON 15 10 100 46 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 @#$#@#$#@ ## WHAT IS IT? This model is an attempt at modelling the behaviour of extorters, their victims and police in the context of the GLODERS project. It uses some but not all of the features described by Luis Gustavo Nardin, Giulia Andrighetto, Rosaria Conte, Mario Paolucci in their IntERS model (http://www.gloders.eu/images/Deliverables/GLODERS_D3-1.pdf) and extends it with territoriality and some more features as discussed during GLODERS project meetings. Whereas an earlier version (http://ccl.northwestern.edu/netlogo/models/community/ARDERS) was mainly devoted to analyse the systemic effects of the behaviour of the agents, whose decision making processes are only modelled rather crudely, this version includes the registration of events by most groups of agents, the identification of these events as relevant for one of the norms which partly govern the agent behaviour as well as the calculation of the salience of these norms for future actions of the agents. This salience is converted into a propensity to take an action by either abiding by the respective norm or violating it. Additionally, this version, in contrast to another earlier version, is event-oriented, i.e. the model does not progress period for period such that in every period (tick) all agents do their businesses in a certain (albeit random) order, but the model proceeds from event to event, initial events being scheduled during initialisation, later events scheduled by the internal logic of action )more details belo). ## HOW IT WORKS The world contains several villages (shape: church) in which several enterprises (shape: house) exist which can fall victim to extortion. Extorters (shape: person) can approach their targets first in their immediate vicinity, if they do not find any more potential victims in their immediate vicinity they extend this vicinity. **Normative board** Agents of all types have a normative board, in which norms are represented, and a mechanism with which they can remember events and norm invocations, and they can calculate the salience of the respective norms as a means to decide which of their possible actions they will apply in a given situation. This works as follows: * Events such as denunciation, paying extortion, shopping and so on trigger messages to agents in the neighbourhood. If an event is related to more than one norm, several messages are broadcast by the agent which triggered the event. Each of these messages contains a reference to a norm (usually the norm or norms which is or are followed or violated by the action). A recipient of such a message updates those of its memory entries which refer to the specified norm according to whether the action is performed by itself or by another agent and whether the message contains a punishment or a sanction. This is implemented in a series of `update-` procedures (the `update-` procedures combine the invocation and the updates). * The calculation of an action probability consists of two steps: the individual drive of shops to denounce and/or to pay is determined by the risk of being extorted compared to the benefit of being protected by the successful extorter. The latter is currently and exogenous variable (`benefit-for-victims`). The individual drive of other kinds of agents is set in a similar manner. The normative drive depends on former experience with an agent's own actions and on observations made of normative behaviour of other agents' in the neighbourhood (see http://www.gloders.eu/images/Deliverables/GLODERS_D3-1.pdf, pp. 33-39). * When an agent has to choose between different action options (including the option of doing nothing) it calculates a probability (`calculate-propensity-from` for actions controlled by only one norm, and `propensity-to` for actions controlled by two conflicting norms) for each of the action options which in turn depends on a rationally calculated "individual drive" (implemented in the procedure `calculate-my-individual-drive-to` with respect to the action named as the procedure's argument) and a "normative drive" which is calculated from the salience of the norm or norms involved in the action option. The salience of the norm, in turn, is calculated according to a complicated formula (implemented in the procedure `calculate-my-normative-drive-to`) which combines the memory of * cases when this agent abided by the respective norm or violated it, * cases when this agent observed norm compliances and violations in its neighbourhood, * cases when this agent received punishments or sanctions and * cases when this agent heard about, applied or personally received invocations of the respective norm. * When an action is related to more than one norm (as is the case with events when pizzo is paid --- as this violates the `DO-NOT-PAY-EXTORTION` norm and at the same time complies with the `PAY-EXTORTION-AS-EVERYBODY-DOES` norm, the decision considers only the one with the higher salience. **Shops** serve for providing the population with goods and services of any type. To keep things simple, these goods and services are not detailed. Shops receive payment from their customers and bear the fixed and variable costs of their business by paying into a funds which is evenly distributed to the population which is considered to provide the shops with the necessary supply (both in goods and sevrices) --- to keep things simple here, too, the households of the population receive an equal share of the overall period income of the shops, as if all of them served as suppliers and workers for the shops equally. Shops are often approached by criminals for "pizzo" which they can refuse at the risk of being severely punished. They can avoid this with a certain propensity to call the police (`denunciation-propensity`), denouncing the extorters and having them prosecuted. When a shop decides to denounce an extorter it joins an "addio-pizzo" movement and makes this fact known to everybody (and to the modeller by changing its colour from blue to red). When a shop decides not to denounce and the extorter (only if it is listed in the criminal records) is observed by the police, the victim collaborates as a witness (not as a denouncer), the extorter is prosecuted and the victim is punished for not not denouncing (it receives both a norm violation and a punishment message with respect to the `DENOUNCE-EXTORTION` norm). In case shops are approached by more than one extorter at the same time --- this happens mainly in the initial phase and represents what might have happened when mafia-like organisations first came into being --- the shops decide whom to pay to, and the successful extorter will then protect the shop against the rivalling extorters. When due to extortion and punishment the asset of a shop falls below zero, it is closed and does not participate in the trading process until it is compensated from a funds filled by the confiscated wealth of the extorters. Shops know about three norms, `DENOUNCE-EXTORTION`, `DO-NOT-PAY-EXTORTION` and `PAY-EXTORTION-AS-EVERYBODY-DOES`. **Consumers** choose a shop for purchasing their goods. They have a certain propensity `my-addio-pizzo-buy-propensity` which they calculate from the salience of their norms `DO-NOT-SHOP-AT-EXTORTION-PAYER` and `BUY-FROM-EXTORTION-PAYER`to choose shops belonging to the "addio-pizzo" movement. If their current shop is closed, they choose another, preferably belonging to the "addio-pizzo" movement and preferably having only a small number of customers (the reason for this is two-fold: they want to avoid crowded shops, and shops with only few customers should get a chance to prosper). **Extorters** start their career as individual criminals and approach the nearest reachable shop, asking for a "pizzo" which is a certain proportion (either `extortion-level-LOW` or `extortion-level-HIGH` depending on the type the extorter belongs to) of its revenue per period. When the shop refuses and the police fails to successfully prosecute the extorter, the latter punishes the shop, taking away a certain proportion of all its assets (either `punishment-severity-LOW` or `punishment-severity-HIGH`, again depending on the type the extorter belongs to). It is understood that all assets of a shop are easily convertible into money, there are no physical assets which could be destroyed. Punishment becomes public, even when the victim does not officially denounce the extorter, the name of the extorter is added to the criminal records, and this extorter is now under observation. If the police hinders the extorter from punishing, the extorter is kept in investigation custody such that it cannot act any longer during the current period. If it is convicted it is brought to jail for a certain number of periods, and all its assets are confiscated and transferred into a funds from which in turn punished shops can be compensated (following a first come--first served principle). If several extorters approach the same shop at the same time, one of them is selected by the shop to protect the shop against rivalling extorters, and the latter subordinate to the former, forming a family and eventually a hierarchy, for instance in case the successful extorter is already subordinate to someone else; if any rivalling extorters already belong to families, the family hierarchy is not changed. Extorters know about two norms, `DO-NOT-BETRAY-COLLEAGUES` and `ABJURE-CRIME` (but these are not yet implemented). At the end of each period extorters embedded in a family structure pay a tribute of `solidarity * wealth` to their respective leaders, and these leaders in turn distribute equal shares of their `wealth * solidarity` to their followers. Extorters can collaborate with the police (become "pentiti") with a certain probability (`ruefulness`) in the phase when they are in investigation custody. This propensity is currently exogenous, but in a future version it will be controlled by the two norms `DO-NOT-BETRAY-COLLEAGUES` and `ABJURE-CRIME` mentioned above. If they decide to behave this way they become inactive forever and denounce their neighbours in the network whose names are then added to the criminal records. Pentiti are removed from the family tree and do no longer participate in the redistribution of wealth within their former family. **Police** try to prosecute a denounced extorter and are successful with a certain probability (`my-prosecution-propensity`) which depends on their earlier experience. Moreover they keep criminal records for all extorter agents which ever were denounced in the past. If such an extorter which has a criminal record comes into the range of vision of police, it is also prosecuted. Arrested extorters cannot continue their activities during the current tick (they are in investigative custody). They know about two norms, `ANXIETY-IS-JUSTIFIED` and `TRY-HARD-TO-IMPRISON`. Beside the police which try to arrest extorters found by denunciation or observation there is also a court (represented by the observer) which can condemn an extorter found guilty. In this case they spend a longer time in jail. The **"logic of action"** mentioned above can be described as follows: Immediately after the initialisation all consumers are scheduled to go shopping at 10:00 of the first day (and to repeat this action once a week at the same time) and to select a shop from whom they will buy — later they will have an opportunity to switch to another shop when their norm salience calculations recommend them to buy from a shop which does not pay extortion. At the same time the extorters are schedule to become active after a delay of three to five days. Moreover the periodic events mentioned above are scheduled. Once an extorter becomes active it starts to find possible victims in its vicinity (whose initial radius is given by a parameter valid for all extorters but which can be extended a factor which is another input parameter whenever the search for victims turns out unsuccessful). If a victim was found it is approached after a small delay (the time between find-victims and wait-for-extorter in Table 2), if not, another attempt at finding victims is made with a delay between approximately 6 and 8 days (150 and 200 hours). If victim and extorter meet, the former makes a decision whether it denounces the latter or whether it pays the requested amount to the latter — the requested amount is a percentage of the current income from sales determined by an input parameter. If the shop decides not to pay or if it has not had any income during the current month it cannot pay, and the ex-torter is scheduled to return within a week. In these cases two outcomes are possible: * if the shop refused to pay in the first meeting the extorter will only be successful if the shop reconsiders its decision neither to denounce nor to pay or * in case the shop was unable to pay anything before the extorter might be successful if the shop in turn was meanwhile successful in selling anything to a paying custom-er, otherwise the shop will be bankrupt and perhaps be re-opened when extortion and/or punishment was the reason of its bankruptcy and the state compensated from confiscated extorter assets. If the victim decides to denounce it ask a police officer nearby and schedules its start-prosecution procedure for some time within the next two weeks, and there is also a chance that the police officer has observed the extorter’s approach (but only if the latter is already in the police’s criminal records, i.e. was denounced earlier on by some other shop or who was found punishing another shop — an activity which is always observable and cannot be concealed, much like arson), and in this case the prosecution also starts within a week. After the extorter was denounced it is scheduled to become active again to find other victims dur-ing the following two weeks (but if it is meanwhile caught by the police the scheduled task will, of course, never be performed). As a further consequence of denunciation, the de-nounced extorter will also plan to punish the shop, and this is scheduled for some time within the next two weeks, provided this extorter has not been brought to custody before this date. If the same victim is approached by several extorters before the former makes the decision between denouncing and paying discussed above, it has to choose among the competing extorters. The successful extorter subordinates its competitors, this forming a growing hier-archy of families which is documented in one of the NetLogo windows (but not analysed in depth so far). The unsuccessful extorters will become active again and try to find victims during the next few days. At the end of each month the extorters’ incomes are redistributed within each family (isolated extorters do not participate in this redistribution process). When a police officer starts to prosecute an extorter (either after denunciation or after po-lice observation) it will take up to 200 days until the extorter is either brought to custody or escaped. In the latter case the extorter will become active again, otherwise it stays in custo-dy until the court (represented by NetLogo’s observer) passes a sentence, which will take between one and about seven months. If the extorter is acquitted he becomes active the next day, if it is sentenced its period of being inactive in jail will be an integer number of years (between three and eight). When the prisoner is released it will again become active and try to find victims within the next few days. A new feature also available in this event-oriented version is an option to reset the memories of all agents (separately for the different agent types). Pressing one of the `reset-...` buttons (while the simulation run is being interrupted) empties the memories of all agent of the respective breed and fills them with norm invocations as if `BACKGROUND`had been set to +100. In behaviour space mode the `event_norm_intervention_batch` can be run to generate runs in which at the end of `intervention-month` all agents of some or all breeds are reset in the same way as discussed in the previous paragraph. `intervention-type = 0` means no intervention, 1, 5..7, 11..13 and 15 reset the public, 2, 5, 8, 9, 11, 13..15 reset the shops, 3, 6..8, 11, 12, 14, 15 reset the police, and 4, 7, 9, 10, 12..15 reset the extorters. In batch mode the model runs for 24 simulated months, and `intervention-month` is set to 12. Additionally, four switches can be used (but not in the batch version, as then all possible intervention combination are set automatically) to schedule interventions for the types separately; these will then occur at the end of the month indicated by the slider `intervention-month`. ## HOW TO USE IT Press `setup` to set all parameters to their standard values. Then change all the sliders and switches that you want to change. The `initial-...` sliders determine the numbers of the different breeds in the world. There is currently no guarantee that arbitrary combinations of the `initial-...` sliders yield reasonable results. The same applies to the sliders which determine wealth and income. If the number of agents is too large for the world to keep them in separate patches you will receive a warning in the output window (bottom right). The `constant-random-seed?` switch allows to run the model with the same random seed for different parameter combinations. If it is set OFF, every run starts with a new random seed. If the `debug?` choser is on, output will be written to the file logfile.txt. Each new run is preceded with the date and time of the start of the run unless the file is deleted. NOT TO BE USED in the applet version! The red and blue extortion links can be switched off with the `show-extortion-links?` switch. Press `populate` to populate the world with all these agents. Press `go-eventwise` to run the model. The model will run for `max-months` simulated months (and can only be stopped with the help of `Tools`->`Halt`). The two groups of plots show what their headlines suggest. The block in the upper right corner contains histograms of norm saliences and of action propensities, the block in the lower right corder contains numbers of shops and extorters for different categories and amounts of wealth these possess.The percentages of different extortion outcomes is also plotted as an average of the past 10 cycles. The last of these moving averages can also be output in the behaviour space version such that it can be analysed as The calculation consists of two steps: the individual drive of shops to denounce and/or to pay is determined by the risk of being extorted compared to the benefit of being protected by the successful extorter. The latter is currently and exogenous variable (`benefit-for-victims`). The individual drive of other kinds of agents is set in a similar manner. The normative drive depends on former experience with an agent's own actions and on observations made of normative behaviour of other agents' in the neighbourhood (see http://www.gloders.eu/images/Deliverables/GLODERS_D3-1.pdf, pp. 33-39). The following sliders control global variables: * `LOCAL` determines the distance within which events can be observed * `NDW` is the weight of the normative drive for calculating the decision probability, the sum of the two weights for individual drive and normative drive is 1.0 * `DISCOUNT` determines the weight of older memory contents (whenever a new event arrives, the number of all previous events is multiplied by `DISCOUNT` before 1 is added for the current event; thus with `DISCOUNT = 1.0` all events have the same weight inependent of their age. * The standard initialisation of the memory of all agents with 0 could be unrealistic as it does not take account of the fact that any snapshot of the real world would start with real actors whose memory is not empty but filled with remembered compliances and violations of norms and past punishments and sanctions. This is why the slider `BACKGROUND` offers the possibility to initialise the agents according either to the standard (empty memories: `BACKGROUND = 0`) or to a "civic" scheme which is intolerant to extortion rackets (`0 < BACKGROUND < 100`) or to a "traditional" scheme which is tolerant to extortion rackets (`-100 < BACKGROUND < 0`), where the absolute amount of `BACKGROUND` denotes how intensive the "civic" or "traditional" scheme is. In behaviour space mode the `event_norm_sensitivity_batch` can be run, then the sliders for `BACKGROUND`, `NDW`, `LOCAL`, `DISCOUNT`, `extortion-level-...`, `punishment-severity-...`, `prosecution-propensity`, `denunciation-propensity`, `benefit-for-victims`, `conviction-probability`, `solidarity`, `consumption-per-period`, `escape-chance`, `extortion-radius-extension`, `vision-range`, `hide-denounce-propensity` and `addio-pizzo-threshold` have no effect. Instead random values are assigned to these variables. In this case multiple runs with a random setting for the parameters which are relevant for the norm version. A CSV file can be written (except in the batch version) in which every extortion case is documented much like in the Palermo database (but still with less information). As this would not work for applets, the respective code is a comment (search for "file" and remove the semicolons to make the code active). ## THINGS TO NOTICE Target enterprises have an initial wealth uniformly distributed between the numbers on the respective min and max sliders, the income of a shop depends on the number of customers currently choosing it. Extorters have two different extortion levels and two different severity levels (as in Nardin et al.) and a consumption per period which is currently fixed for all extorters at the same level. The difference between extortion and punishment severity levels can, of course, be suppressed by setting the sliders to the same value. Extortion is a proportion (`extortion-level`) of the income per period, punishment for not paying is a proportion (`punishment-severity`) of the total wealth of the target. Often the local hierarchies agglomerate to one unique hierarchy. The model keeps an extortion database of all attempted or successful extortion cases with information on whether the extorters were denounced, observed, prosecuted or condemned. (not for the batch version, and in this version the respective code must be made active by removing the semicolons in all respective lines.) The model calculates the main parameters of the norm salience distributions (mean and standard deviation). ## THINGS TO DISCUSS The formula for calculating salience could be simplified. As weighting coefficients are multiples of 0.33 one could replace them with the respective multiples of 1.0 and change the `numerator` and the `denominator` accordingly. The formula is claimed in Deliverable 3.1 to have been extracted from Cialdini, R. B., Kallgren, C. A., Reno, R. R. (1990). A focus theory of normative conduct: A theoretical refinement and reevaluation of the role of norms in human behavior. Advances in Experimental Social Psychology. 24: 201–234. But it seems that only the terms used in this formula were extracted from this source (which does not say anything about the weights). "DO-NOT-PAY-EXTORTION" and "PAY-EXTORTION-AS-EVERYBODY-DOES" are not just the two sides of a coin but two norms which are in conflict. As the effects of these norms exclude each other (extortion is either paid or not paid) it is necessary to discuss how the probability of paying is calculated. The simple version would be to assume that every violation of one of the two morms is a compliance with the other. But then sanctions and punishments of the two norms cannot be separated. Burning down the shop is certainly a punishment for a violation of the "PAY-EXTORTION-AS-EVERYBODY-DOES" norm, but what is it in terms of the "DO-NOT-PAY-EXTORTION" norm? This model introduces norms relevant for the police and the extorter agents which have never been discussed among the GLODERS teams. Obviously, their behaviour, too, will be controlled by norms in the real world, and hence the model should include norms for these agent types, too. Without having implemented anything reasonable about them, the model contains two norms for each of them (see above). Not all norm invocations have been implemented yet, perhaps some norm-related messages have been forgotten. They will be inserted in future versions. ## THINGS TO TRY The model can be used to find out which of the input parameters guiding the behaviour of the various kinds of agents have the greatest impact on the various output parameters (see Troitzsch 2014). This is best done using the `event_norm_sensitivy_batch` in behavour space. It goes without saying that the model, although inspired by results of empirical research into individual behaviour done within the GLODERS project, has not yet been validated with respect to its output variables, thus it cannot be used to guide policy making, but it gives hints at which empirical macro variables to analyse. The output generated by the model in a CSV file can be used to perform similar analyses as those made with the empirical data in the siciliy and Calabria database (629 cases of extortion which became known to the police and the courts, see the papers cited below). ## EXTENDING THE MODEL The model could be extended by endowing the agents with even more learning capabilities. Particularly extorters could then optimise their behaviour as a reaction on punishment and sanctions. And certainly the relations between the public and the shops could be modelled in more detail, e.g. by having individual consumers work for one shop and purchase different kinds of goods from several different shops. ## NETLOGO FEATURES Nothing special. The code uses recursive functions to determine to which family an extorter belongs and to write up the hierarchy in the output window. This version makes use of the time extension (which needs to be present either in the directory where the model resides or in the `extensions` directory of the NetLogo installation. ## RELATED MODELS There are three mafia models in the community (http://ccl.northwestern.edu/netlogo/models/community/Siste%20Mafia33,%20edited%202, http://ccl.northwestern.edu/netlogo/models/community/The%20Mafia%20Model%20-%20Interaction%20between%20police,%20mafia%20and%20storewoners and http://ccl.northwestern.edu/netlogo/models/community/When%20Mafias%20and%20States%20Cohabitate) which I have not consulted so far. Predecessors of this version can be found at * http://ccl.northwestern.edu/netlogo/models/community/ARDERS is a period oriented version with constant action probabilities for all agent-types * http://ccl.northwestern.edu/netlogo/models/community/NOERS is a period oriented version with norm oriented behaviour of all agent types, much like in this version ## CREDITS AND REFERENCES The research leading to these results has received funding from the European Union Seventh Framework Programme (FP7/2007--2013) under grant agreement no. 315874 ([Global dynamics of extortion racket systems, GLODERS](http://www.gloders.eu)). These results reflect only the author’s views, and the European Union is not liable for any use that may be made of the information contained therein. The author thanks his colleagues in this and earlier projects for fruitful discussions over many years. The model owes a lot to the Nardin et al. discussion paper and to the discussions within the GLODERS project. The GLODERS project used earlier versions of this model as a proof of concept and a quick and dirty prototype of the final GLODERS simulator. The model, its predecessors and some of its first results are documented in http://www.gloders.eu/images/Deliverables/GLODERS_D2-3.pdf The following papers dealing with earlier (period-oriented) versions of this model have already been published or have been accepted: * Troitzsch, Klaus G. (2015). Distribution Effects of Extortion Racket Systems. In F. M. Amblard (Hrsg.), Advances in Artificial Economics. Berlin: Springer. pp. 181–193. http://link.springer.com/chapter/10.1007/978-3-319-09578-3_15 * Troitzsch, Klaus G. (2015). Extortion Racket Systems as Targets for Agent-Based Simulation Models. Comparing Competing Simulation Models and Emprical Data. Advances in Complex Systems, 18. http://www.worldscientific.com/doi/abs/10.1142/S0219525915500149 * Troitzsch, Klaus G. (2016). Can agent-based simulation models replicate organised crime? Trends in Organised Crime. To appear. * Nardin, Luis G.; Andrighetto, Giulia; Conte, Rosaria; Székely, Áron; Anzola, David; Elsenbroich, Corinna; Lotzmann, Ulf; Neumann, Martin; Punzo, Valentina; Troitzsch, Klaus G. (2016). Simulating the Dynamics of Extortion Racket Systems: A Sicilian Mafia Case Study. Autonomous Agents and Multi-Agent Systems. http://link.springer.com/article/10.1007/s10458-016-9330-z * Troitzsch, Klaus G. (2016). Using empirical data for designing, calibrating and validating simulation models. To appear in the Proceedings of the Social Simulation Conference, Groningen, September 2015. A more detailed description of modelling results of this version will appear in the final GLODERS book to appear in late 2016: * Elsenbroich, Corinna; Anzola, David; Gilbert, Nigel, eds. (2016). Social Dimensions of Organised Crime. Modelling the Dynamics of Extortion Rackets. New York: Springer 2016 ## HOW TO CITE Cite this model with the URL http://ccl.northwestern.edu/netlogo/models/community/EONOERS ## COPYRIGHT NOTICE Written by Klaus G. Troitzsch 2013-2016. The model may be used and extended if the source is quoted and a note is sent to kgt@uni-koblenz.de @#$#@#$#@ default true 0 Polygon -7500403 true true 150 0 60 270 150 225 240 270 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 bird false 0 Polygon -7500403 true true 135 165 90 270 120 300 180 300 210 270 165 165 Rectangle -7500403 true true 120 105 180 237 Polygon -7500403 true true 135 105 120 75 105 45 121 6 167 8 207 25 257 46 180 75 165 105 Circle -16777216 true false 128 21 42 Polygon -7500403 true true 163 116 194 92 212 86 230 86 250 90 265 98 279 111 290 126 296 143 298 158 298 166 296 183 286 204 272 219 259 227 235 240 241 223 250 207 251 192 245 180 232 168 216 162 200 162 186 166 175 173 171 180 Polygon -7500403 true true 137 116 106 92 88 86 70 86 50 90 35 98 21 111 10 126 4 143 2 158 2 166 4 183 14 204 28 219 41 227 65 240 59 223 50 207 49 192 55 180 68 168 84 162 100 162 114 166 125 173 129 180 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 church false 0 Polygon -7500403 true true 105 15 75 285 105 285 135 285 Rectangle -7500403 true true 120 180 225 285 Rectangle -7500403 true true 120 180 225 285 Rectangle -7500403 true true 120 180 225 285 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 police false 0 Circle -7500403 false true 45 45 210 Polygon -7500403 true true 96 225 150 60 206 224 63 120 236 120 Polygon -7500403 true true 120 120 195 120 180 180 180 185 113 183 Polygon -7500403 false true 30 15 0 45 15 60 30 90 30 105 15 165 3 209 3 225 15 255 60 270 75 270 99 256 105 270 120 285 150 300 180 285 195 270 203 256 240 270 255 270 285 255 294 225 294 210 285 165 270 105 270 90 285 60 300 45 270 15 225 30 210 30 150 15 90 30 75 30 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 top-down-triangle false 0 Polygon -7500403 true true 150 270 285 45 15 45 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 5.3.1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go-eventwise time:is-equal TNOW stopdate current-seed BACKGROUND LOCAL DISCOUNT NDW benefit-for-victims conviction-probability vision-range extortion-level-low punishment-severity-low hide-denounce-propensity escape-chance extortion-radius-extension mean-shop-wealth-addio-pizzo mean-shop-wealth-non-addio-pizzo n-families n-shops-non-addio-pizzo n-shops-addio-pizzo n-shops-still-paying addio-pizzo-shopping-percentage percentage-of-undetected-cases percentage-of-unreported-cases percentage-of-completed-extortions percentage-of-cases-with-arrest percentage-of-cases-with-punishment denunciation-rate success-rate prosecution-rate arrest-rate conviction-rate percentage-of-critical-consumers ticks item 0 all-means item 0 all-sds item 1 all-means item 1 all-sds item 2 all-means item 2 all-sds item 3 all-means item 3 all-sds item 4 all-means item 4 all-sds item 5 all-means item 5 all-sds item 6 all-means item 6 all-sds item 7 all-means item 7 all-sds item 8 all-means item 8 all-sds item 9 all-means item 9 all-sds no-extortion-after setup go-eventwise time:is-equal TNOW stopdate or seconds-since-startdate > 2000 run-type current-seed BACKGROUND LOCAL DISCOUNT NDW benefit-for-victims conviction-probability vision-range extortion-level-low punishment-severity-low hide-denounce-propensity escape-chance extortion-radius-extension mean-shop-wealth-addio-pizzo mean-shop-wealth-non-addio-pizzo n-families n-shops-non-addio-pizzo n-shops-addio-pizzo n-shops-still-paying addio-pizzo-shopping-percentage percentage-of-undetected-cases percentage-of-unreported-cases percentage-of-completed-extortions percentage-of-cases-with-arrest percentage-of-cases-with-punishment denunciation-rate success-rate prosecution-rate arrest-rate conviction-rate percentage-of-critical-consumers ticks item 0 all-means item 0 all-sds item 1 all-means item 1 all-sds item 2 all-means item 2 all-sds item 3 all-means item 3 all-sds item 4 all-means item 4 all-sds item 5 all-means item 5 all-sds item 6 all-means item 6 all-sds item 7 all-means item 7 all-sds item 8 all-means item 8 all-sds item 9 all-means item 9 all-sds no-extortion-after setup go-eventwise time:is-equal TNOW stopdate current-seed BACKGROUND LOCAL DISCOUNT NDW benefit-for-victims conviction-probability vision-range extortion-level-low punishment-severity-low hide-denounce-propensity escape-chance extortion-radius-extension mean-shop-wealth-addio-pizzo mean-shop-wealth-non-addio-pizzo n-families n-shops-non-addio-pizzo n-shops-addio-pizzo n-shops-still-paying addio-pizzo-shopping-percentage percentage-of-undetected-cases percentage-of-unreported-cases percentage-of-completed-extortions percentage-of-cases-with-arrest percentage-of-cases-with-punishment denunciation-rate success-rate prosecution-rate arrest-rate percentage-of-critical-consumers conviction-rate ticks item 0 all-means item 0 all-sds item 1 all-means item 1 all-sds item 2 all-means item 2 all-sds item 3 all-means item 3 all-sds item 4 all-means item 4 all-sds item 5 all-means item 5 all-sds item 6 all-means item 6 all-sds item 7 all-means item 7 all-sds item 8 all-means item 8 all-sds item 9 all-means item 9 all-sds no-extortion-after @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 arc 0.5 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 my-arc 1.0 -0.2 1 4.0 4.0 0.0 1 1.0 0.0 0.2 1 4.0 4.0 link direction true 0 Polygon -7500403 true true 150 150 120 195 180 195 150 150 @#$#@#$#@ 1 @#$#@#$#@