REGULOPOLIS v0.6c

REGULOPOLIS v0.6c preview image

1 collaborator

Default-person Tony Casey (Author)

Tags

(This model has yet to be categorized with any tags)
Parent of 1 model: REGULOPOLIS v0.6e.2
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.0 • Viewed 242 times • Downloaded 24 times • Run 0 times
Download the 'REGULOPOLIS v0.6c' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;;;;;;;;;;;;;;;;;;;;;;
;;; Identification ;;;
;;;;;;;;;;;;;;;;;;;;;;

;; Program Name: REGULOPOLIS
;; Author(s): Tony Casey
;; Email: tony.casey@ucdconnect.ie
;; Requirements: Netlogo 5.2

;;;;;;;;;;;;;;;;;;;;;;;
;;; Version Control ;;;
;;;;;;;;;;;;;;;;;;;;;;;

;; Version: v0.01  9th  July 2015   (Tony Casey)    Initial version.
;;          v0.1   23rd July 2015   (Tony Casey)    Added in basic 'resource' and 'distance' based modeling.
;;                                                  Added in 'review panel' logic.
;;                                                  Added in 'spring' visualisation logic (after Uri Wilensky).
;;                                                  Split orchestration / choreography code.
;;                                                  Added in 'scorecard' logic.
;;                                                  Added in ECJ enforcement logic.
;;          v0.2   24th July 2015   (Tony Casey)    Added in 'policy interdependence' logic, weighted links are conceptualised as a proxy for policy interdependence.
;;          v0.3   30th July 2015   (Tony Casey)    Added in logic to ensure that algorithmically generated hubs are plausible, i.e. SRA's and large countries.
;;          v0.4a  31st July 2015   (Tony Casey)    Added in path-distance from NRA to Agency/Network logic as proxy for time to complete OECD stage
;;          v0.5   01st Aug  2015   (Tony Casey)    Added in variable centrality
;;          v0.6b  13th Aug  2015   (Tony Casey)    Added in 'oversight'logic (a.k.a. Abbott et al.), compliance plot
;;          v0.6c  14th Aug  2015   (Tony Casey)    Added in 'goal divergence logic' (a.k.a Abbott et al.), refined compliance plot, much tweaking of compliance logic

;;;;;;;;;;;;;;;;;;;;;;
;;; General ToDo's ;;;
;;;;;;;;;;;;;;;;;;;;;;

;; Tidy up temporarilyInSetUpCode (any stable parameters should be moved to user-selectable interface).
;; Independent domestic oversight variable for each NRA
;; Independent goal divergence variable for each NRA

;;;;;;;;;;;;;;;;
;;; Acronyms ;;;
;;;;;;;;;;;;;;;;

;; ERR           European Regulatory Regime
;; ERN           European Regulatory Network
;; IN            Independent Network
;; CN            Commission Network
;; A             Agency;
;; AN            Agencified Network
;; NA            Networked Agency
;; NRA           National Regulatory Authority
;; SNA           Supra National Authority
;; NT            Node Type
;; EPC           Epistimic Community
;; COM           European Commission
;; EPRG          European Regulator Group for Posal Services
;; MS            Member State



;;;;;;;;;;;;;;;;;;
;;; Extensions ;;;
;;;;;;;;;;;;;;;;;;

extensions [matrix nw]

;;;;;;;;;;;;;;;;;
;;; Interface ;;;
;;;;;;;;;;;;;;;;;

;; enforcementPyramid?        ; user defined chooser on inteface, takes values 'system defined (all)', 'EU review panel', 'EU scorecard', 'ECJ ruling', from 'soft' to 'hard' enforecement.
;; reveiwPanelEffect?         ; user defined slider on interface, 0 to 100% uplift of regulatory compliance on 'regulatory gap' as a result of effect of review panel.
;; rcPeerEffectOnGap?         ; user defined slider on interface, 0 to 100% uplift of regulatory compliance on 'regulatory gap' as a result of effect of scorecards.
;; preferential-attachment?   ; type of 'centrality' measure, used to layout visualisation and weight path distance from NRA to central agency/network
;; tight DomesticOversight?   ; user defined switch on interface, simple global variable, in later versions could be set independently for each NRA
;; goalDivergence?            ; user defined slider on interface, takes values 0 = none, 1 = medium, 2 = high

;;;;;;;;;;;;;;;;;;;;;;;;
;; Agent Data Model  ;;;
;;;;;;;;;;;;;;;;;;;;;;;;

globals [
  euEnlargementNum            ; can take values 6, 12, 15, 25, 28
  errNum                      ; varies depending how many non-NRA agents
  errList                     ; varies depending on EU-6, EU-12, EU-15, EU-25, EU-28, Commission, Epistemic Community, Independent Network etc.
  errMatrix                   ; to hold externally excell created text matrix
  errType                     ; "12" used (1-12 Levi-Faur ERR types identified, differentiates topology and processing rules, partially used this version)
  errRegulatoryDistance       ; holds list representing "distance" of new eu-regime to existing nra-regime
  errSharedOntology           ; holds list representing shared "understanding" i.e. existance/adoption of standards = high, non-existance/non-adoption = low
  errCycle                    ; counter holding the current regulatory regime cycle (used to maintain overall state of regulatory regime)
  errRegTranspositionNum      ; stage number for regulatory transposition, currently 7 (stage 7)
  avgCompliance               ; regulatory regime average compliance (total pct-complance / euEnlargementNum)
  medCompliance               ; regulatory regime median compliance
  regulatory-hub1             ; keep a track of where the important hubs are
  ia-stage-time-required      ; default is 60 days per ia-stage, but this can be multiplied by an NRA's shortest path to an EU agency or network as a proxy for co-ordination effort required
  allTickedOut                ; so we know when to stop the model
  p                           ; general purpose counter
]

breed [errNodes errNode]      ; European Regulatory Regime Node, EU-15 or Commission, Epistemic Community, Independent Network
breed [SNAs SNA]              ; "EPRG" used (European Regulator Group for Postal Services, many other INs identified  by Levi-Faur, partially used this version)
breed [NRAs NRA]              ; "EU-15" used (To impliment EU-6, EU-12, EU-15, EU-25, EU-28, partially used this version)
breed [INs IN]                ; not used this version
breed [CNs CN]                ; not used this version
breed [As A]                  ; not used this version
breed [ANs AN]                ; not used this version
breed [NAs NA]                ; not used this version

errNodes-own [
  node-id                     ; IE, UK, DE, EPRG etc.
  node-type                   ; SNA, NRA, EPC etc.)
  ia-stage                    ; "impact assessment-stage" values 0 to 8, drives the transposition of EU regulation to domestic regulation (based on OECD (OffCom) 'Better Regulation', 2005) 
                              ; (Stage) 0:  undefined
                              ; (Stage) 1:  defining the issue we need to consider and identifying the citizen or consumer interest
                              ; (Stage) 2:  defining the policy objective
                              ; (Stage) 3:  identifying the options
                              ; (Stage) 4:  identifying the impacts on different types of stakeholders
                              ; (Stage) 5:  identifying any impacts on competition
                              ; (Stage) 6:  assessing the impacts and choosing the best option
                              ; (Stage) 7:  transpose EU regulation to domestic regulation
                              ; (Stage) 8:  (enforcement pyramid) EU review panel
                              ; (Stage) 9:  (enforcement pyramid) EU scorecard
                              ; (Stage) 10: (enforcement pyramid) ECJ ruling
  ia-stage-time-passed        ; value is 0 to 59, placeholder for elapsed time at each is-stage
  stand-off                   ; binary, takes values "yes" "no", it is possible that regulation is 'moth-balled' indefinitely in consultation stalement with stake-holders 
  oecd-ceiling                ; where in the OECD IA cycle we are stuck, currently takes the values default 0 (all OECD IA stages possible) but the value 4 if a strong NRA is pushing back and the value 6 if a weak NRA cannot get it accross the domestic legislative line  
  eurozone-cluster            ; PIIGS, Northern, Scandinavian etc., not used this version
  regulatory-distance         ; distance of existing NRA regime from proposed EU regime
  enforcement-escalation      ; takes values 0,1,2,3; maintains where each NRA is in the enforcement pyramid
  pct-compliance              ; percent compliance of NRA regime to proposed EU regime
  world-view                  ; distance of errNode view from "zeitgeist"
  ontological-distance        ; distance of "formal" standards
  zeitgeist                   ; owned by the Epistemic Community          
  budget                      ; owned by the European Commission
  resources                   ; staff, budget, capacity
  all-ticked-out              ; so we know when to stop NRA  
]

SNAs-own [
  working-groups
  review-panels
]

links-own [
  policyInterdependence       ; a.k.a. 'weight'
]

;;;;;;;;;;;;;;;;;;;;;;;;
;;; Setup Procedures ;;;
;;;;;;;;;;;;;;;;;;;;;;;; 

to setup
  clear-all
  set-default-shape errNodes "circle"
  setupERR                    ; setup the European Regulatory Regime
  reset-ticks
end 

to setupERR
  temporarilyInSetUpCode      ; all this procedure to be user selectable and eventually moved to interface
  setupERRNetwork
  setupERRNodes
  setupERRLinks
end 

to temporarilyInSetUpCode     ; general first-cut dumping ground for potential independent variable parameters before moving to user selectable interface
  set errNum 18               ; EU-15, plus Commission, Epistemic Community, Independent Network
  set euEnlargementNum 15     ; EU-15
  set errType 12
  ; test data arranged in ascending order of centrality
  set errList ["LU" "FI" "IE" "PT" "EL" "AT" "DK" "BE" "NL" "ES" "SE" "IT" "UK" "FR" "DE" "EPC" "Commission" "Reg Agency"]
  ; test data which is mapped to errList
  set errRegulatoryDistance [0 1 0 -2 -2 0 0 -1 0 0 1 1 1 2 0 1 0 0]
  ; test data which is mapped to errList
  ;set errSharedOntology [1 0 0 0 -1 0 0 1 -1 0 0 0 0 0 1 0 1 -1]
  set-current-directory "C:\\Users\\Tony\\OneDrive\\Msc Public Policy (UCD)\\Course Descriptions\\Thesis (GSHS40200)\\My NetLogo Code"
  set errMatrix "errMatrix.txt"
  set errRegTranspositionNum 7; currently 7 because 'regulatory transposition happens at 7 in the 8 stage OECD impact assessment model
  set ia-stage-time-required 2;default is 60 days per stage * length of NRA path to Agency/Network hub (as a proxy for the coordination effort required) 
  set allTickedOut "no"
end 

to setupERRNetwork            
  if regulatoryForm? = "orchestration (star)" [                                          ; create 'star' network from excel sheet 
    nw:load-matrix errMatrix errNodes links]                                             ; test matrix to be replaced with empirically constructed matrix in later versions 
  if regulatoryForm? = "choreography (small-world)" [                                    ; create 'small-world' network using the generator in netlogo nw exension                                           
    nw:generate-small-world errNodes links 6 3 2.0 false]                                ; with live data this will be swapped out for empirically constructed matrix
  if regulatoryForm? = "choreography (scale-free)" [                                     ; create 'scale-free' network using the generator in netlogo nw exension                                           
    nw:generate-preferential-attachment errNodes links errNum]                           ; with live data this will be swapped out for empirically constructed matrix
end 

to setupERRNodes                                                                         ; populate network nodes
  if regulatoryForm? = "orchestration (star)" [                                          ; Nice and easy, matrix data is already ordered plausibly
    ask errNodes [
      print (word "node-id = " node-id " who = " who)
      set node-id item who errList
      print (word "node-id = " node-id " who = " who)
      set regulatory-distance item who errRegulatoryDistance
      set ia-stage 0
      set ia-stage-time-passed 0
      set resources 50
      set pct-compliance 0
      set all-ticked-out "no"
      set stand-off "no"
      set oecd-ceiling 0
      if labelsOn? [
        set label node-id]   
      ifelse (node-id != "Reg Agency") and (node-id != "Commission") and (node-id != "EPC")
        [set node-type "NRA"
         set color red
        ]         
        [set node-type "SRA"         
         if node-id = "Reg Agency"[       
           set regulatory-hub1 who]                                                     ; so we can calculate the shortest distance
         ifelse node-id = "EPC"
           [set color green]
           [set color blue]
         ]           
    ]  
  ]
  if (regulatoryForm? = "choreography (small-world)") or (regulatoryForm? = "choreography (scale-free)") [ ; These networks generated algorithmically so needs some pre-processing to ensure hubs are plauasable, i.e SRA's and big countries 
    set p 0
    foreach sort-on [runresult measure] errNodes [
      ask ? [
        set node-id item p errList
        print (word "p = " p " errList = " (item p errList))                            ; debug code
        set regulatory-distance item who errRegulatoryDistance
        set ia-stage 0
        set ia-stage-time-passed 0
        set resources 50
        set pct-compliance 0
        set all-ticked-out "no"
        set stand-off "no"
        set oecd-ceiling 0
        if labelsOn? [
          set label node-id]   
        ifelse (node-id != "Reg Agency") and (node-id != "Commission") and (node-id != "EPC")
          [set node-type "NRA"
           set color red
          ]         
          [set node-type "SRA"
             if node-id = "Reg Agency" [
               set regulatory-hub1 who
               print (word "regulatory-hub1 = " regulatory-hub1)                        ; debug code
               set node-id "Reg Body"
               if labelsOn? [
                 set label node-id]                                                     ; No agencies in this regulatory form
             ]
             ifelse node-id = "EPC"
               [set color green]
               [set color blue]
          ]
      set p p + 1
      ]  
    ] 
 ]
end 

to setupERRLinks
  if (regulatoryForm? = "choreography (small-world)") or (regulatoryForm? = "choreography (scale-free)") [
    ; these networks generated algorithmically so make sure there are no orphan "EPC" or "Commission" nodes not linked to "Reg Body"
    ask errNodes [
      if (node-id = "EPC") or (node-id = "Commission") [
        if not (link-neighbor? errNode regulatory-hub1) [
          create-link-with (errNode regulatory-hub1) ]
      ]   
    ]
  ] 
end  

;;;;;;;;;;;;;;;;;;;;;;;
;;; Main Procedures ;;;
;;;;;;;;;;;;;;;;;;;;;;;

to go
  ifelse allTickedOut = "no" [    
    errConverge                                                                         ; main processing loop, NRA regulation 'converges' on EU directive
    foreach sort errNodes [                                                             ; debug code
      ask ? [print (word "who = " who " id = " node-id " node-type = " node-type " ia = " ia-stage " rd = " regulatory-distance " resources = " resources " tick = " ticks " oecd-ceiling = " oecd-ceiling " pct compliance = " pct-compliance)]
      ask ? [print (word "path length to agency/network = " (nw:distance-to (errNode regulatory-hub1)))]
    ]
  ]
    [stop]
  if all? (errNodes with [node-type = "NRA"]) [all-ticked-out = "yes"]
    [set allTickedOut "yes"]
  adjust-sizes
  layout
  tick
end   

to errConverge                                                                   ; loop through the OECD 'better regulation' impact assessment life-cycle; core logic is 'resources' and 'distance' based (to which is be added progressively more sophisticated agent behaviour)
  foreach sort errNodes [
    ask ? [
      if (ia-stage < errRegTranspositionNum) [                                   ; i.e. regulation not yet 'transposed'
        ifelse ia-stage = 0 [
          if regulatory-distance = 0
            [set ia-stage 3]                                                     ; low domestic alignment required
          if (regulatory-distance = 1) or (regulatory-distance = -1)             ; left/right behaviour not differentiated this version
            [set ia-stage 2]                                                     ; higher domestic alignment required
          if (regulatory-distance = 2) or (regulatory-distance = -2) [           ; left/right behaviour not differentiated this version
            if tightDomesticOversight? [
              set oecd-ceiling 4]                                                ; the strong NRA is going to push back
            set ia-stage 1                                                       ; highest domestic alignment required
          ]                                                       
          ]       
          [ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1)))
             [set ia-stage-time-passed ia-stage-time-passed + 1]
             [ifelse oecd-ceiling != 0                                           ; put the strong NRA into a holding pattern
               [ifelse (ia-stage = oecd-ceiling) and (enforcementPyramid? != "3. ECJ ruling (all)") ; nuclear option required to break out of holding pattern
                 [set ia-stage-time-passed 0 
                   set stand-off "yes"
                   if all-ticked-out = "no" [
                     set resources resources - 5]
                 ]
                 [set ia-stage ia-stage + 1
                  set ia-stage-time-passed 0 
                  if ia-stage = oecd-ceiling [
                    set stand-off "yes"
                  ]
                  if all-ticked-out = "no" [
                    set resources resources - 5]
                 ]
               ]             
               [set ia-stage ia-stage + 1                                         
                set ia-stage-time-passed 0 
                if all-ticked-out = "no" [
                  set resources resources - 5]
               ]
            ]
          ]
      ]          
      if (ia-stage = errRegTranspositionNum) and (node-type = "NRA") [           ; OECD stage 7, regulation transposed, set pct-compliance of NRAs
        ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1)))
           [set ia-stage-time-passed ia-stage-time-passed + 1]
           [set ia-stage-time-passed 0
            set ia-stage ia-stage + 1                                             
            if all-ticked-out = "no" [
                set resources resources - 5]       
            if (regulatory-distance = 0)   
              [set pct-compliance 90]
            if (regulatory-distance = 1) or (regulatory-distance = -1)
              [set pct-compliance 70]
            if (regulatory-distance = 2) or (regulatory-distance = -2)
              [set pct-compliance 50]
            if (enforcementPyramid? = "4. (none)")                                                                
              [set all-ticked-out "yes"]
            ]     
        ]      

      if (ia-stage > errRegTranspositionNum) and (node-type = "NRA") [         
      ; finish, regulation 'transposed' but EU enforcement pyramid may apply 'peer' preasure to increase domestic compliance 
        if (enforcementPyramid? = "1. EU review panel (1 only)")[                                                                
          if ia-stage = errRegTranspositionNum + 1 [
            ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1))) [
              errReviewPanel
              set ia-stage-time-passed ia-stage-time-passed + 1]
             [if all-ticked-out = "no" [
                set resources resources - 5]
              set all-ticked-out "yes"]
          ]
        ]
        if (enforcementPyramid? = "2. EU scorecard (1 and 2)") or (enforcementPyramid? = "0. 'soft' default (1 and 2)")[
          if ia-stage = errRegTranspositionNum + 1 [
            ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1))) [
              errReviewPanel
              set ia-stage-time-passed ia-stage-time-passed + 1]
             [set ia-stage ia-stage + 1
              set ia-stage-time-passed 0                                        
              if all-ticked-out = "no" [
                set resources resources - 5]
             ]
          ]        
          if (ia-stage = errRegTranspositionNum + 2) [
            ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1))) [
               print (word "got into 2nd loop " "ia-stage = " ia-stage)
               errScoreCard
               set ia-stage-time-passed ia-stage-time-passed + 1]
              [if all-ticked-out = "no" [
                 set resources resources - 5]
               set all-ticked-out "yes"]
          ]
        ]
        if (enforcementPyramid? = "3. ECJ ruling (all)") [   
          if ia-stage = errRegTranspositionNum + 1 [
            ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1))) [
              print (word "got into 1st loop " "ia-stage = " ia-stage)
              errReviewPanel
              set ia-stage-time-passed ia-stage-time-passed + 1]
             [set ia-stage ia-stage + 1
              set ia-stage-time-passed 0                                         
              if all-ticked-out = "no" [
                set resources resources - 5]
             ]
          ]        
          if (ia-stage = errRegTranspositionNum + 2) [
            ifelse ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1))) [
              print (word "got into 2nd loop " "ia-stage = " ia-stage) 
              errScoreCard
              set ia-stage-time-passed ia-stage-time-passed + 1]
             [set ia-stage ia-stage + 1                                         
              set ia-stage-time-passed 0
              if all-ticked-out = "no" [
                set resources resources - 5]
            ]
          ]      
          if (ia-stage = errRegTranspositionNum + 3) and (regulatoryForm? = "orchestration (star)") [                   ; the nuclear option is only available to agencies with statutory powers
              print (word "got into 2.5th loop " "ia-stage = " ia-stage)
            ifelse (ia-stage-time-passed < (ia-stage-time-required * (nw:distance-to (errNode regulatory-hub1)))) [
              print (word "got into 3rd loop " "ia-stage = " ia-stage)      
              errECJRuling
              set ia-stage-time-passed ia-stage-time-passed + 1]
             [if all-ticked-out = "no" [
                set resources resources - 5]
              if stand-off = "no" [
                set all-ticked-out "yes"]
             ]
          ]
          if (ia-stage = errRegTranspositionNum + 3) and (regulatoryForm? != "orchestration (star)") [
              if stand-off = "no" [
                set all-ticked-out "yes"]
          ]
        ]
      ]  
      ]
    ]
end 

;to-report path-length
;  report task [ nw:path-to turtle (who with (node-id = "Reg Agency")) ]
;end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Enforcement Pyramid Procedures ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to errReviewPanel                                                                                                  ; modelled to effect 'volume' of domestic regulation (after Maggetti & Gilardi, 2014)                                                                 
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"]                                     ; peer uplift a pct of 'un-transposed' i.e. the regulatory gap, another possibility is simple peer uplift of pct 'transposed', should be user selectable in new version
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  print (word "pct compliance = " pct-compliance " rp average compliance = " avgCompliance " oecd ceiling = " oecd-ceiling " ia-stage = " ia-stage)                         ; debug code
  ifelse (pct-compliance >= avgCompliance) or (node-type = "SRA")  
    [set pct-compliance pct-compliance * 1]                                                                        ; do nothing, making assumption that peer preasure has no effect when transposition already greater than or equal to the average or a strong NRA.
    [ifelse oecd-ceiling = 0
      [set pct-compliance (((100 - pct-compliance) * (1 + (reveiwPanelEffect? / 100))) - (100 - pct-compliance)) + pct-compliance] ; simulate 'peer' preasure to increase compliance of 'regulatory gap' by (default) 20%
      [set pct-compliance pct-compliance * 1
        if oecd-ceiling = ia-stage [
          set stand-off "yes"
        ] 
      ]
    ] 
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"] 
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  print (word "rp avg compliance = " avgCompliance)                                                                 ; debug code
  print (word "rp median compliance = " medCompliance)                                                              ; debug code
end  

to errScoreCard
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"]                                      ; peer uplift a pct of 'un-transposed' i.e. the regulatory gap, another possibility is simple peer uplift of pct 'transposed', should be user selectable in new version
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  ifelse (pct-compliance >= avgCompliance) or (node-type = "SRA")
    [set pct-compliance pct-compliance * 1]                                                                         ; do nothing, making assumption that peer preasure has no effect when transposition already greater than or equal to the average or a strong NRA.
    [ifelse oecd-ceiling = 0
      [set pct-compliance (((100 - pct-compliance) * (1 + (scoreCardEffect? / 100))) - (100 - pct-compliance)) + pct-compliance] ; simulate 'peer' preasure to increase conpliance of 'regulatory gap' by (default) 20%
      [set pct-compliance pct-compliance * 1
        if oecd-ceiling = ia-stage [
          set stand-off "yes"
        ]
      ]
    ]
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"] 
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  print (word "sc avg compliance = " avgCompliance)                              ; debug code
  print (word "sc median compliance = " medCompliance)                           ; debug code
end 

to errECJRuling
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"]   ; this is a 'nuclear' rarely used option, modelled as user selectable probability of ECJ winning the case
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  ifelse (pct-compliance >= (avgCompliance + complianceMargin?)) or (stand-off = "yes") or (node-type = "SRA")                      
    [set pct-compliance pct-compliance * 1                                       ; do nothing, making the assumption this is last resort and reserved for NRAs not reaching a threshold 'median' transposition 
     set stand-off "no"                                                          ; the EC is not going after these
    ]                         
    [ifelse random 100  <= (ECJWinProbability?)                                  ; produces a pseudo-random number between 0 and 99 and if it is less than or equal to the probability of the ECJ winning then the ruling is enforced
       [set pct-compliance 100
        set stand-off "no"]                                                      ; EC wins
       [set stand-off "yes"]

    ]
  set avgCompliance mean [pct-compliance] of errNodes with [node-type = "NRA"] 
  set medCompliance median [pct-compliance] of errNodes with [node-type = "NRA"]
  print (word "sc avg compliance = " avgCompliance)                              ; debug code
  print (word "sc median compliance = " medCompliance)                           ; debug code
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Visualisation Procedures ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to layout
  ;if not layout? [ stop ]
  ;; the number 10 here is arbitrary; more repetitions slows down the
  ;; model, but too few gives poor layouts
  repeat 10 [
    do-layout
    display  ;; so we get smooth animation
  ]
end 

to do-layout
  ;layout-spring errNodes links 0.4 6 1                                           ; baseline for tests
  if regulatoryForm? = "orchestration (star)" [                                   ; create 'star' network from excel sheet (text file)
    layout-spring errNodes links 0.3 (world-width / (sqrt errNum)) 1]             ; a bit prettier
  if regulatoryForm? = "choreography (small-world)" [                             ; create 'small-world' network using the generator in netlogo nw exension                                             
    layout-spring errNodes links 0.8 12 2]                                        ; a bit prettier
  if regulatoryForm? = "choreography (scale-free)" [                              ; create 'small-world' network using the generator in netlogo nw exension                                             
    layout-spring errNodes links 0.8 12 2]                                        ; a bit prettier
end 

to adjust-sizes
  ;; We want the size of the errNodes to reflect their centrality, but there are different centrality measures 
  ;; giving different ranges of size, so we normalize the sizes according to the formula 
  ;; below. We then use the normalized sizes to pick an appropriate color.
  if count errNodes > 0 [
    let results sort [ runresult measure ] of errNodes ;; results of the measure in increasing order
    let delta last results - first results ;; difference between biggest and smallest
    let base-size world-width / 50 ; set a base-size relative to the width of the world
    ifelse delta = 0 [ ;; if they all have the same value
      ask errNodes [ set size base-size ]
    ]
    [ ;; remap the size to a range of sizes from the base size to quadruple the base size
      let size-range base-size * 2
      ; note that we call runresult measure a second time, but since the centrality results
      ; are stored behind the scene by the nw extension, the cost of doing that is acceptable
      ask errNodes [ set size base-size + (((runresult measure - first results) / delta) * size-range) ]
    ]    
  ]
end 

to-report measure
  ; returns a different reporter task that can be run by the turtles (errNodes), depending on which
  ; preferential attachment mechanism is selected in the chooser (to be implimented).
  if preferential-attachment? = "1. degree centrality" [ report task [ count my-links ] ]
  if preferential-attachment? = "2. betweenness centrality" [ report task [ nw:betweenness-centrality ] ]
  if preferential-attachment? = "3. closeness centrality" [ report task [ nw:closeness-centrality ] ]
  if preferential-attachment? = "4. eigenvector centrality" [ report task [ nw:eigenvector-centrality ] ]
  report task [ 1 ] ; used for "none" - they all get equal values
end             



 

There is only one version of this model, created almost 10 years ago by Tony Casey.

Attached files

File Type Description Last updated
REGULOPOLIS v0.6c.png preview Preview for 'REGULOPOLIS v0.6c' almost 10 years ago, by Tony Casey Download

This model does not have any ancestors.

Children:

Graph of models related to 'REGULOPOLIS v0.6c'