The SWAP Model

The SWAP Model preview image

1 collaborator

Pj Peter Johnson (Author)

Tags

conservation 

Tagged by Peter Johnson over 10 years ago

farmer behaviour 

Tagged by Peter Johnson over 10 years ago

farming 

Tagged by Peter Johnson over 10 years ago

soil and water conservation 

Tagged by Peter Johnson over 10 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.2 • Viewed 1021 times • Downloaded 86 times • Run 0 times
Download the 'The SWAP Model' 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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

breed          [ farmers farmer ]
breed          [ extension-agents extension-agent ]

patches-own    [ soil-quality                       ;; score, normally distributed
                 soil-conservation-practised        ;; ?, false, true
                 owned-by                           ;; which turtle (farmer) owns the field
                 ]                                  
                 

farmers-own [    soil-conservation-decision         ;; not_accepted, accepted_not_adopted, adopted
                 acceptance-decision-score          ;; 0 = start, 1 = symptoms recognised, 2 = effects recognised, 3 = taken 
                                                    ;; serious, 4 = aware of methods, 5 = able to undertake, 6 = willing to 
                                                    ;; undertake, 7 = ready to unertake, 8 = accepted
                                  
              ;; household characteristics
                
                 age-of-decision-maker              ;; yrs, initially normally distributed
                 education-of-decision-maker        ;; normally distributed
                                  
                 successor                          ;; ?, Y/N, true / false
                 
                 decision-maker-does-labouring      ;; ?, Y/N, true / false
                 
                 size-of-household                  ;; ppl, normally distributed
  
              ;; economic attributes
                 
                 land-tenure-status                 ;; owned or rented
                 labour-access                      ;; ?, Y/N, true or false
                 credit-access                      ;; ?, Y/N, true or false
                 number-of-fields-owned             ;; No. of patches a farmer agent owns/rents
                 
                 
                 income                             ;; = no. of fields owned * soil quality of fields owned * knowledge of land
                 savings                            ;; normally distributed
                 consumption-requirement            ;; = size of household * consumption-reqiurement-per-individual
                 
                 risk-aversion                      ;; score, normally distributed
                 discount-rate                      ;; normally distributed
              
              ;; social attributes
              
                 cultural-inertia                   ;; score, normally distributed 
                 adherence-to-norms                 ;; score, normally distributed 
                 institution-attitude               ;; score, normally distributed 
                 influence-score                    ;; score, normally distributed 
              
              
              ;; other attributes
  
                 knowledge-of-land                  ;; same as age
                 knowledge-of-technology            ;; score, normally distributed 
                 extension-worker-contact           ;; ?, Y/N, ture of false,
                 
                 my-farm                            ;; group of patches owned by a turtle
                 
                 average-soil-quality-of-farm       ;; mean soil quality of my farm
                 
                 timeHadSWC                         ;; steps a farmer has practised SWC
                 timesDisadopted                    ;; count times a farmer disadopts
                 
                 %OfMyFarmwithSWC                   ;; % of patches of a farm with SWC
                 
                 ]
             
globals        [ number-of-shock-weather-events     ;; count shock weather events
                 decisions-to-accept                ;; count acceptance decisions
                 decisions-to-adopt                 ;; count adoption decisions
                 decisions-to-stop-adoption         ;; count disadoption decisions
                 case-study-name                    ;; case study name monitor
                 
                 IoD                                ;; Index of dissimilarity and its calculation (4 quadrants)
                 DareaA
                 DareaB
                 DareaC
                 DareaD
               
                  ]  
   
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;SETUP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SETUP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; load case study data for ease of use and 'playing'

to CasestudyTigray
  
   set average-age-of-decision-maker 47
   set average-years-of-education 4.79
   set average-size-of-household 4.6
   set average-savings 100
   set consumption-per-individual 200
   set average-risk-aversion 50
   set average-discount-rate 0.15
   set average-cultural-inertia 50
   set average-adherence-to-norms 59.4
   set average-institutional-attitude 50
   set average-influence-score 50
   set average-knowledge-of-tech 50
   set inital-proportion-farmers-practising-conservation 0.1
   set proportion-of-households-with-successor 0.422
   set proportion-of-households-with-decision-maker-labourer 0.9
   set proportion-of-households-own-land 0.75
   set proportion-of-households-with-labour-access 0.2
   set proportion-of-households-with-credit-access 0.1
   set proportion-of-households-with-extension-contact 0.574
   set death-age 60.5
   set case-study-name "Tigray"
   
   ;; different calibrated values for last two interaction types
   
   if interaction-types = "extension worker" [   set average-institutional-attitude 30 
                                                 set average-risk-aversion 75
                                                 set average-discount-rate 0.4
                                                 set average-cultural-inertia 80
                                                 set average-influence-score 30
                                                 set average-knowledge-of-tech 20 ]
   
   if interaction-types = "all"              [   set average-institutional-attitude 15 
                                                 set average-risk-aversion 90
                                                 set average-discount-rate 0.5
                                                 set average-cultural-inertia 90
                                                 set average-influence-score 15
                                                 set average-knowledge-of-tech 15 ]
end 

to CaseStudySENigeria
  
   set average-age-of-decision-maker 54.6
   set average-years-of-education 7.01
   set average-size-of-household 4.52
   set average-savings 100
   set consumption-per-individual 200
   set average-risk-aversion 50
   set average-discount-rate 0.15
   set average-cultural-inertia 50
   ifelse random 10 > 4 [ set average-adherence-to-norms 40 ] [ set average-adherence-to-norms 60 ]
   set average-institutional-attitude 50
   set average-influence-score 50
   set average-knowledge-of-tech 50
   set inital-proportion-farmers-practising-conservation 0.1
   ifelse random 10 > 4 [ set proportion-of-households-with-successor 0.4 ]
                        [ set proportion-of-households-with-successor 0.6 ]
   set proportion-of-households-with-decision-maker-labourer 0.73
   set proportion-of-households-own-land 0.61
   set proportion-of-households-with-labour-access 0.745
   set proportion-of-households-with-credit-access 0.204
   set proportion-of-households-with-extension-contact 0.33
   set death-age 53
   set case-study-name "SE Nigeria"
   
   ;; different calibrated values for last two interaction types
   
   if interaction-types = "extension worker" [   set average-institutional-attitude 30 
                                                 set average-risk-aversion 75
                                                 set average-discount-rate 0.4
                                                 set average-cultural-inertia 80
                                                 set average-influence-score 30
                                                 set average-knowledge-of-tech 20 ]
   
   if interaction-types = "all"              [   set average-institutional-attitude 15 
                                                 set average-risk-aversion 90
                                                 set average-discount-rate 0.5
                                                 set average-cultural-inertia 90
                                                 set average-influence-score 15
                                                 set average-knowledge-of-tech 15 ]
end 

to caseStudyCebu
  
   set average-age-of-decision-maker 48.2
   set average-years-of-education 4.4
   set average-size-of-household 4.8
   set average-savings 100
   set consumption-per-individual 200
   set average-risk-aversion 50
   set average-discount-rate 0.15
   set average-cultural-inertia 50
   if random 3 = 2 [ set average-adherence-to-norms 40 ] 
   if random 3 = 1 [ set average-adherence-to-norms 50 ]
   if random 3 = 0 [ set average-adherence-to-norms 60 ]
   set average-institutional-attitude 50
   set average-influence-score 50
   set average-knowledge-of-tech 50
   set inital-proportion-farmers-practising-conservation 0.1
   ifelse random 10 > 4 [ set proportion-of-households-with-successor 0.4 ]
                        [ set proportion-of-households-with-successor 0.6 ]
   ifelse random 10 > 4 [ set proportion-of-households-with-decision-maker-labourer 0.6 ] 
                        [ set proportion-of-households-with-decision-maker-labourer 0.9 ] 
   set proportion-of-households-own-land 0.45
   set proportion-of-households-with-labour-access 0.3
   set proportion-of-households-with-credit-access 0.3
   set proportion-of-households-with-extension-contact 0.08
   set death-age 73
   set case-study-name "Cebu"
   
   ;; different calibrated values for last two interaction types
   
   if interaction-types = "extension worker" [   set average-institutional-attitude 30 
                                                 set average-risk-aversion 75
                                                 set average-discount-rate 0.4
                                                 set average-cultural-inertia 80
                                                 set average-influence-score 30
                                                 set average-knowledge-of-tech 20 ]
   
   if interaction-types = "all"              [   set average-institutional-attitude 15 
                                                 set average-risk-aversion 90
                                                 set average-discount-rate 0.5
                                                 set average-cultural-inertia 90
                                                 set average-influence-score 15
                                                 set average-knowledge-of-tech 15 ]
end 

;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;main setup;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup
  
  clear-all
  setup-patches-and-create-turtles
  set-farmer-attributes
  set-case-study-name
  my-update-plots
  reset-ticks
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;GO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GO;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  
  farmer-decision-start-point
  extension-agents-move
  update-patches 
  update-attributes
  ask farmers with [ soil-conservation-decision = "adopted" ] [ set timeHadSWC timeHadSWC + 1 ]
  IoDiss
  tick
  my-update-plots
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROCEDURES IN SETUP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROCEDURES IN SETUP;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup-patches-and-create-turtles
  
  ;; creating pathes and turtles
  
  ask patches [
    
    ;; set initial soil quality
    
    set soil-quality random-normal 25 10
    
    let my-area patches in-radius 1
    
    if ( mean [ soil-quality ] of my-area ) > soil-quality [ set soil-quality soil-quality + 5 ]
    if ( mean [ soil-quality ] of my-area ) < soil-quality [ set soil-quality soil-quality - 5 ] 
    
    ;; set initial practice
    
    set soil-conservation-practised false 
    
    ;; set patch colors, brown no conservation, green conservation, 
    ;; darker shade means higher quality, lighter means lower quality
           
    if ( soil-quality < 25 ) and ( soil-conservation-practised = true ) [ set pcolor 59 ]
    if ( soil-quality >= 25 ) and ( soil-quality < 50 ) and ( soil-conservation-practised = true ) [ set pcolor 57 ]
    if ( soil-quality >= 50 ) and ( soil-quality < 75 ) and ( soil-conservation-practised = true ) [ set pcolor 54 ]
    if soil-quality >= 75 and (soil-conservation-practised = true ) [ set pcolor 52 ]
    
    if ( soil-quality < 25 ) and ( soil-conservation-practised = false ) [ set pcolor 39 ]
    if ( soil-quality >= 25 ) and ( soil-quality < 50 ) and ( soil-conservation-practised = false ) [ set pcolor 37 ]
    if ( soil-quality >= 50 ) and ( soil-quality < 75 ) and ( soil-conservation-practised = false ) [ set pcolor 34 ]
    if soil-quality >= 75 and (soil-conservation-practised = false ) [ set pcolor 32 ]
    ]

  ;;  create population
  
  ;;  create new agents, spread randomly, set appearance ( extension agents first )
  
  if ( interaction-types = "extension worker" ) or ( interaction-types = "all" ) 
  
                                [ create-extension-agents ( number-of-initial-farmers / 20 )  [                         
                                  setxy random-pxcor random-pycor
                                  set shape "triangle"
                                  set color red 
                                  set size 1.5
  ]]
                                  create-farmers number-of-initial-farmers  [ 
                                  setxy random-pxcor random-pycor
                                  if any? other farmers-here [ move-to one-of patches with [ not any? farmers-here ] ]
                                  set shape "circle"
                                  set color red 
                                  set size 1]
                                  
                                  ;; turtle owns patches it's nearest to
  
                                  ask patches 
                                  
                                [ set owned-by min-one-of farmers [distance myself] ] 
end 

;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;; 
;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;;
;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;; setting farmers attributes;;

to set-farmer-attributes
  
;; setup farmer parameters, using case study data for a mean of normal distribution, SD set at a plausible level

ask farmers [ 
  
              ;; basics for outputs
              
              set timeHadSWC 0
              set timesDisadopted 1 ;; set at 1 to avoid division by zero when used in outputs/plots
              
              ;; score based parameters
                                  
              set age-of-decision-maker random-normal average-age-of-decision-maker 10
              set education-of-decision-maker random-normal average-years-of-education 3
              set size-of-household random-normal average-size-of-household 3
                                  
              set number-of-fields-owned count patches with [ owned-by = myself ]                                  
              set my-farm patches with [ owned-by = myself ]
                                  
              set income 
              (  ( number-of-fields-owned *  mean [ soil-quality ] of my-farm ) + knowledge-of-land )
                                  
              set savings random-normal average-savings 40 
              set consumption-requirement ( size-of-household * consumption-per-individual ) 
                                                   
              set risk-aversion random-normal average-risk-aversion 20 
              ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                [ set risk-aversion risk-aversion - 30 ] )
              set discount-rate random-normal average-discount-rate 0.07
                                  
              set cultural-inertia random-normal average-cultural-inertia 20 
              ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                [ set cultural-inertia cultural-inertia - 30 ] )
              set adherence-to-norms random-normal average-adherence-to-norms 20
              set institution-attitude random-normal average-institutional-attitude 20 
              ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                [ set institution-attitude institution-attitude  + 30 ] )
              set influence-score random-normal average-influence-score 20
  
              set knowledge-of-land age-of-decision-maker 
              set knowledge-of-technology random-normal average-knowledge-of-tech 20 
              ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                [ set knowledge-of-technology knowledge-of-technology - 30 ] )
                                  
              set average-soil-quality-of-farm mean [ soil-quality ] of my-farm
                                  
              set soil-conservation-decision "not_accepted"  ]
                                  
              ;; some farmers already practise SC
                                  
              ask n-of ( inital-proportion-farmers-practising-conservation * count farmers ) farmers 
                [ set soil-conservation-decision "adopted" 
                  set color black ask n-of (0.5 * count my-farm) my-farm 
                       [ set soil-conservation-practised true 
                         if ( soil-quality < 25 ) and ( soil-conservation-practised = true ) 
                              [ set pcolor 59 ]
                         if ( soil-quality >= 25 ) and ( soil-quality < 50 ) and ( soil-conservation-practised = true ) 
                              [ set pcolor 57 ]
                         if ( soil-quality >= 50 ) and ( soil-quality < 75 ) and ( soil-conservation-practised = true ) 
                              [ set pcolor 54 ]
                         if soil-quality >= 75 and ( soil-conservation-practised = true ) 
                              [ set pcolor 52 ]
                              ] ] 
                                  
              ask farmers [ if soil-conservation-decision = "not_accepted" [ set acceptance-decision-score 0 ]
                            if soil-conservation-decision = "accepted_not_adopted" [ set acceptance-decision-score 7 ]
                            if soil-conservation-decision = "adopted" [ set acceptance-decision-score 7 ] 
                                  
                                  ] 
                               
              ;; proportion Y/N parameters
                                                                                                                                
              ask farmers [ set successor false ]
                                  
              ask n-of ( proportion-of-households-with-successor * count farmers ) farmers [ set successor true ]
                                  
              ask farmers [ set decision-maker-does-labouring false ]
                                  
              ask n-of ( proportion-of-households-with-decision-maker-labourer * count farmers ) farmers 
              [ set decision-maker-does-labouring true ]
                                   
              ask farmers [ set land-tenure-status "rented" ]
                                  
              ask n-of ( proportion-of-households-own-land * count farmers ) farmers 
              [ set land-tenure-status "owned" ]
                                  
              ask farmers [ set labour-access false ]
                                  
              ask n-of ( proportion-of-households-with-labour-access * count farmers ) farmers 
              [ set labour-access true ]
                                  
              ask farmers [ set credit-access false ]
                                  
              ask n-of ( proportion-of-households-with-credit-access * count farmers ) farmers 
              [ set credit-access true ]
                                  
              ask farmers [ set extension-worker-contact false ]
                                  
              ask n-of ( proportion-of-households-with-extension-contact * count farmers ) farmers 
              [ set extension-worker-contact true ]
end  

;; double checking labelling of run using death age

to set-case-study-name
  if death-age = 60.5 [ set case-study-name "Tigray" ]
  if death-age = 53 [ set case-study-name "SE Nigeria" ]
  if death-age = 73 [ set case-study-name "Cebu" ]
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROCEDURES IN GO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROCEDURES IN GO;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; farmers have to start their decision in right place each tick so...

to farmer-decision-start-point
  ask farmers [ if soil-conservation-decision = "not_accepted" OR soil-conservation-decision = "accepted_not_adopted" 
    [ ask my-farm [ set soil-conservation-practised false ] ] ]
  
  ask farmers [ if any? my-farm with [ soil-conservation-practised = true ] [ run-continued-use-decision]
                if not any? my-farm with [ soil-conservation-practised = true ] [ run-decide-between-accept-and-adopt ]]
end 

;; farmers current 'opinion' affects which decision procedure to now run

to run-decide-between-accept-and-adopt
  
       if soil-conservation-decision = "not_accepted" [ run-acceptance-decision  ]
       if soil-conservation-decision = "accepted_not_adopted" [ run-adoption-decision ]
       if soil-conservation-decision = "adopted" [ run-continued-use-decision ]
end 

;; choose which stage of acceptance decision to run according to current 'opinion'

to run-acceptance-decision 
  
 ;; 10% probability of accepting need for SWC by chance
  
 ifelse random 100 > 89 [ accept-conservation ] [
 if acceptance-decision-score = 0 [ degradation-symptoms-recognised ]
 if acceptance-decision-score = 1 [ degradation-effects-recognised  ]
 if acceptance-decision-score = 2 [ degradation-taken-serious ]
 if acceptance-decision-score = 3 [ aware-of-conservation-methods ]
 if acceptance-decision-score = 4 [ able-to-undertake-conservation ]
 if acceptance-decision-score = 5 [ willing-to-undertake-conservation ]
 if acceptance-decision-score = 6 [ ready-to-undertake-conservation ]
 if acceptance-decision-score = 7 [ accept-conservation ]
 ]
end 

;; the following 8 procedures are the acceptance decision process

to degradation-symptoms-recognised
           
           let deg-symp-recog ( ( 100 - soil-quality ) + knowledge-of-land )
           
           if  ( deg-symp-recog > 100 ) and ( decision-maker-does-labouring = true ) 
           [ set acceptance-decision-score  1 ]
end 

to degradation-effects-recognised          
           
            let deg-eff-recog 
            (( 100 - age-of-decision-maker ) + knowledge-of-land + education-of-decision-maker + ( 100 - cultural-inertia ))
            
            if  ( deg-eff-recog > 125 ) and ( extension-worker-contact = true ) 
            [ set acceptance-decision-score 2 ] 
end 

to degradation-taken-serious
 
            if (  extension-worker-contact = true ) and ( land-tenure-status = "owned" ) [ set acceptance-decision-score 3 ]
end 

to aware-of-conservation-methods
 
            if ( knowledge-of-technology > 60 ) and (  extension-worker-contact = true ) [ set acceptance-decision-score 4 ]
end 

to able-to-undertake-conservation

            if ( age-of-decision-maker < 75 ) and ( labour-access = true ) and 
               (  extension-worker-contact = true ) and ( credit-access = true ) and ( land-tenure-status = "owned" ) 
               [ set acceptance-decision-score 5 ]
               
            if ( age-of-decision-maker < 75 ) and ( size-of-household > 3 )  and 
               (  extension-worker-contact = true ) and ( credit-access = true ) and ( land-tenure-status = "owned" ) 
               [ set acceptance-decision-score 5 ]
               
            if ( age-of-decision-maker < 75 ) and ( labour-access = true ) and 
               (  extension-worker-contact = true ) and ( savings > 75 ) and ( land-tenure-status = "owned" ) 
               [ set acceptance-decision-score 5 ]
               
            if ( age-of-decision-maker < 75 ) and ( size-of-household > 3 )  and 
               (  extension-worker-contact = true ) and ( savings > 75 ) and ( land-tenure-status = "owned" ) 
               [ set acceptance-decision-score 5 ]
end 

to willing-to-undertake-conservation

            let willing 
            ((  100 - ( discount-rate * 100 ) ) + ( 100 - cultural-inertia ) + 
              institution-attitude + ( 100 - age-of-decision-maker ))
              
            if ( willing > 100 ) and ( successor = true ) and ( decision-maker-does-labouring = true ) 
            [ set acceptance-decision-score 6 ]
end 

to ready-to-undertake-conservation

            let ready ( ( 100 - risk-aversion ) + savings + income )
            
            if ( ready > 200 ) [ set acceptance-decision-score 7 ]
end 

to accept-conservation

    set soil-conservation-decision "accepted_not_adopted"
    set decisions-to-accept decisions-to-accept + 1
    set color blue
    ask my-farm [set soil-conservation-practised false ]
end 

;; adoption decision - run once acceptance is true

to run-adoption-decision
  
  if ( risk-aversion > 80 ) 
      
          [ set soil-conservation-decision "accepted_not_adopted" 
            set color blue ask my-farm [ set soil-conservation-practised false ] ]                                    
                        
  if ( risk-aversion > 60 ) and ( risk-aversion <= 80 ) and (  extension-worker-contact = true )
  
          [ set soil-conservation-decision "adopted" 
            set color black 
            set decisions-to-adopt decisions-to-adopt + 1 
            ask n-of ( 0.1 * count my-farm ) my-farm [ set soil-conservation-practised true ]]
  
  if ( risk-aversion > 40 ) and ( risk-aversion <= 60 ) and (  extension-worker-contact = true )
  
          [ set soil-conservation-decision "adopted" 
            set color black 
            set decisions-to-adopt decisions-to-adopt + 1 
            ask n-of ( 0.25 * count my-farm ) my-farm [ set soil-conservation-practised true ]]
 
  if ( risk-aversion > 20 ) and ( risk-aversion <= 40 ) and (  extension-worker-contact = true ) 
  
          [ set soil-conservation-decision "adopted" 
            set color black 
            set decisions-to-adopt decisions-to-adopt + 1 
            ask n-of ( 0.5 * count my-farm ) my-farm [ set soil-conservation-practised true ]]
  
  if ( risk-aversion <= 20 ) and (  extension-worker-contact = true )
  
          [ set soil-conservation-decision "adopted" 
            set color black 
            set decisions-to-adopt decisions-to-adopt + 1 
            ask n-of ( 0.75 * count my-farm ) my-farm [ set soil-conservation-practised true ]]
end 

;; contined use decision

to run-continued-use-decision
  
  ;; increase or reduce adoption dependent on results ie., income
  
  if ( income > consumption-requirement ) 
  [ ask n-of ( 0.2 * count my-farm with [ soil-conservation-practised = false ] ) 
    my-farm with [ soil-conservation-practised = false ] 
    [ set soil-conservation-practised  true  ] ]
  
  if ( income < consumption-requirement ) 
  [ ask n-of ( 0.2 * count my-farm with [ soil-conservation-practised = true ] ) 
    my-farm with [ soil-conservation-practised = true ]  
    [ set soil-conservation-practised false ] ]
  
  
 ;; if very low adoption, stop altogether
  
  if ( soil-conservation-decision = "adopted" ) and 
  ( count my-farm with  [ soil-conservation-practised = true ] < ( 0.1 * count my-farm )) 
  
  [ set soil-conservation-decision "accepted_not_adopted" 
    set color blue 
    set decisions-to-stop-adoption decisions-to-stop-adoption + 1  
    set timesDisadopted timesDisadopted + 1
    ask my-farm [ set soil-conservation-practised false ] ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; extension agents have to move so...

to extension-agents-move
  
  if ( interaction-types = "extension worker" ) or ( interaction-types = "all" ) 
  [ ask extension-agents [ set heading random 360 fd 10 ] ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;UPDATE VARIABLES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UPDATE VARIABLES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to update-patches
  
                ;; chance of shock weather event
  
                if random-float 100 < 4 [  set number-of-shock-weather-events number-of-shock-weather-events + 1
                                           ask patches 
                                           [ set soil-quality soil-quality - (( random-normal 0.5 0.1 ) * soil-quality ) ]]
                
  
  ask patches [ ;; random noise in soil quality
    
                ifelse random 2 = 1 [ set soil-quality soil-quality + 5.8 ] [ set soil-quality soil-quality - 5 ] 
                        
                ;; effect of conservation
                
                if ( soil-conservation-practised = true ) [ set soil-quality soil-quality + 8 ] 
                
                if ( soil-conservation-practised = false ) [ set soil-quality soil-quality - 1 ] 
               ]
                 
                ;; fields around a field affect it 
                
  ask patches [ let my-area patches in-radius 1
    
                if ( mean [ soil-quality ] of my-area ) > soil-quality [ set soil-quality soil-quality + 5 ]
                if ( mean [ soil-quality ] of my-area ) < soil-quality [ set soil-quality soil-quality - 5 ] 
                
                ;; regulate scores within 0-100
                
                if soil-quality > 100 [ set soil-quality 95 ]  
                if soil-quality < 0 [ set soil-quality 5 ]               
                 
                ;; update colour of patches each tick 
                  
                if ( soil-quality < 25 ) and ( soil-conservation-practised = true ) 
                [ set pcolor 59 ]
                if ( soil-quality >= 25 ) and ( soil-quality < 50 ) and ( soil-conservation-practised = true ) 
                [ set pcolor 57 ]
                if ( soil-quality >= 50 ) and ( soil-quality < 75 ) and ( soil-conservation-practised = true ) 
                [ set pcolor 54 ]
                if soil-quality >= 75 and ( soil-conservation-practised = true ) 
                [ set pcolor 52 ]
    
                if ( soil-quality < 25 ) and ( soil-conservation-practised = false ) 
                [ set pcolor 39 ]
                if ( soil-quality >= 25 ) and ( soil-quality < 50 ) and ( soil-conservation-practised = false ) 
                [ set pcolor 37 ]
                if ( soil-quality >= 50 ) and ( soil-quality < 75 ) and ( soil-conservation-practised = false ) 
                [ set pcolor 34 ]
                if soil-quality >= 75 and ( soil-conservation-practised = false ) 
                [ set pcolor 32 ]
  ]
end 

to update-attributes 
  
  ;; update income, consumption req, contact with ext, age, knowledge of land, knowledge of tech
  
  ask farmers [ 
    
                ;; calc prop of my farm with SWC
                
                set %OfMyFarmwithSWC round 
                ((( count my-farm with [ soil-conservation-practised = true ] ) / (count my-farm )) * 100 ) 
                
                ;; age and knowledge of land go up with time
    
                set age-of-decision-maker age-of-decision-maker + 0.25
                set knowledge-of-land age-of-decision-maker
                
                ;; update farm soil quality and income
                
                set average-soil-quality-of-farm mean [ soil-quality ] of my-farm
                set income  ( number-of-fields-owned *  mean [ soil-quality ] of my-farm ) + knowledge-of-land 
                
                ;; spatial / locality effects
                
                local-effects    ;; below - these are the interaction types
                
                ;; death - if have a successor all attributes stay same except age, 
                ;; if no successor, all change, soil cons decision will be back to not accepted
                
                if ( age-of-decision-maker > ( death-age * random-normal 1 0.2 ) ) and ( successor = true ) 
                [ set age-of-decision-maker 20 
                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-successor  
                  [ set successor false ] [set successor true ]] 
                
                
                if ( age-of-decision-maker > ( death-age * random-normal 1 0.2 ) ) and ( successor = false ) [ 
                  
                                  set age-of-decision-maker random-normal average-age-of-decision-maker 10
                                  set education-of-decision-maker random-normal average-years-of-education 3
                                  set size-of-household random-normal average-size-of-household 3
                                  
                                  set number-of-fields-owned count patches with [ owned-by = myself ]                                  
                                  set my-farm patches with [ owned-by = myself ]
                                  
                                  set income 
                                  ( number-of-fields-owned *  mean [ soil-quality ] of my-farm ) + knowledge-of-land
                                  
                                  set savings random-normal average-savings 40 
                                  set consumption-requirement ( size-of-household * consumption-per-individual )  
                                                   
                                  set risk-aversion random-normal average-risk-aversion 20 
                                  ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                                    [ set risk-aversion risk-aversion - 30 ] )
                                  set discount-rate random-normal average-discount-rate 0.07
                                  
                                  set cultural-inertia random-normal average-cultural-inertia 20 
                                  ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                                    [ set cultural-inertia cultural-inertia - 30 ] )
                                  set adherence-to-norms random-normal average-adherence-to-norms 20
                                  set institution-attitude random-normal average-institutional-attitude 20 
                                  ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                                    [ set institution-attitude institution-attitude  + 30 ] )
                                  set influence-score random-normal average-influence-score 20
  
                                  set knowledge-of-land age-of-decision-maker 
                                  set knowledge-of-technology random-normal average-knowledge-of-tech 20 
                                  ( if ( age-of-decision-maker < average-age-of-decision-maker ) 
                                    [ set knowledge-of-technology knowledge-of-technology - 30 ] )
                                  
                                  set average-soil-quality-of-farm mean [ soil-quality ] of my-farm
                                  
                                  set soil-conservation-decision "not_accepted" 
                                  set timesDisadopted timesDisadopted + 1
                                  set color red
                                                                            
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-successor  
                                  [ set successor false ] [set successor true ]
                                  
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-decision-maker-labourer 
                                  [ set decision-maker-does-labouring false ] [set decision-maker-does-labouring true ]
                                  
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-own-land 
                                  [ set land-tenure-status "rented" ] [set land-tenure-status "owned" ]
                                  
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-labour-access 
                                  [ set labour-access false ] [set labour-access true ]
                                  
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-credit-access 
                                  [ set credit-access false ] [set credit-access true ]
                               
                                  ifelse ( random-float 1 + 0.00001 ) > proportion-of-households-with-extension-contact 
                                  [ set extension-worker-contact false ] [set extension-worker-contact true ] 
  ]
             
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;interaction effects;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to local-effects
  
                if interaction-types = "farmer groups" [ farmer-groups ]
                if interaction-types = "influential individuals" [ influential-individuals ]
                if interaction-types = "extension worker" [ extension-worker ]
                if interaction-types = "all" [ all-local-effects ]
end 

to farmer-groups
  
                ;; if farmer effects turned on, and any or all of my group are using SC, and i have adherence to norms above 30, 
                ;; then 'increase' some variables and thus chance of adoption / acceptance
                   
                let my-farmer-group farmers in-radius 10  
                
                if ( adherence-to-norms > 50 ) and ( any? my-farmer-group with [ soil-conservation-decision = "adopted" ]  ) 
                           
                           [ set knowledge-of-technology knowledge-of-technology + ( 0.2 * knowledge-of-technology ) 
                             set risk-aversion risk-aversion - ( 0.2 * risk-aversion )
                             set cultural-inertia cultural-inertia - ( 0.2 * cultural-inertia )
                              ]
                
                if (adherence-to-norms > 50 ) and ( all? my-farmer-group [ soil-conservation-decision = "adopted" ] )
                
                           [ set knowledge-of-technology knowledge-of-technology + ( ( 2 * 0.2 ) * knowledge-of-technology ) 
                             set risk-aversion risk-aversion - ( ( 2 * 0.2 ) * risk-aversion )
                             set cultural-inertia cultural-inertia - ( ( 2 * 0.2 ) * cultural-inertia )
                              ]
                           
                if ( soil-conservation-decision = "not_accepted" ) and 
                  (( count my-farmer-group with [ soil-conservation-decision = "adopted" ]) > 
                    ( 0.75 * count my-farmer-group )) and ( adherence-to-norms > 50 )
                
                      [ set soil-conservation-decision "accepted_not_adopted" 
                        set color blue 
                        set decisions-to-accept decisions-to-accept + 1 
                        ask my-farm [ set soil-conservation-practised false 
                        ]]
end 

to influential-individuals
  
  ;; like a leader some agents have very high influence over others in their group- 
  ;; others will  take on their scores - like a leader
  
  let my-farmer-group farmers in-radius 10 
  
  if influence-score > 80 [ ask my-farmer-group [ 
      
                             set knowledge-of-technology [ knowledge-of-technology ] of myself 
                             set risk-aversion [ risk-aversion ] of myself
                             set cultural-inertia [ cultural-inertia ] of myself
      
  ]]
end 

to extension-worker
  
  ;; extension agents roam around randomly and set new scores for farmers..
  
  if any? extension-agents in-radius 1
  
  [                          set knowledge-of-technology knowledge-of-technology + ( 0.3 * knowledge-of-technology )  
                             set risk-aversion risk-aversion - ( 0.3 * risk-aversion )
                             set cultural-inertia cultural-inertia - ( 0.3 * cultural-inertia )
                             set extension-worker-contact true
                             
                             if ( random 4 >= 2 ) and ( soil-conservation-decision = "not_accepted" ) 
                             [ set soil-conservation-decision "accepted_not_adopted" 
                               set color blue 
                               set decisions-to-accept decisions-to-accept + 1 
                               ask my-farm [set soil-conservation-practised false ]]
  ]
end 

to all-local-effects
  
  let my-farmer-group farmers in-radius 10  
                
                if ( adherence-to-norms > 50 ) and ( any? my-farmer-group with [ soil-conservation-decision = "adopted" ]  ) 
                           
                           [ set knowledge-of-technology knowledge-of-technology + ( 0.2 * knowledge-of-technology ) 
                             set risk-aversion risk-aversion - ( 0.2 * risk-aversion )
                             set cultural-inertia cultural-inertia - ( 0.2 * cultural-inertia )
                              ]
                
                if (adherence-to-norms > 50 ) and ( all? my-farmer-group [ soil-conservation-decision = "adopted" ] )
                
                           [ set knowledge-of-technology knowledge-of-technology + ( ( 2 * 0.2 ) * knowledge-of-technology ) 
                             set risk-aversion risk-aversion - ( ( 2 * 0.2 ) * risk-aversion )
                             set cultural-inertia cultural-inertia - ( ( 2 * 0.2 ) * cultural-inertia )
                              ]
                           
                if ( soil-conservation-decision = "not_accepted" ) and 
                (( count my-farmer-group with [ soil-conservation-decision = "adopted" ]) > 
                  ( 0.75 * count my-farmer-group )) and ( adherence-to-norms > 50 ) 
                
                   [ set soil-conservation-decision "accepted_not_adopted" 
                     set color blue 
                     set decisions-to-accept decisions-to-accept + 1 
                     ask my-farm [set soil-conservation-practised false ] ]     
  
  if influence-score > 80 [ ask my-farmer-group [ 
      
                             set knowledge-of-technology [ knowledge-of-technology ] of myself 
                             set risk-aversion [ risk-aversion ] of myself
                             set cultural-inertia [ cultural-inertia ]  of myself ] ]
  
  if any? extension-agents in-radius 1
  
  [                          set knowledge-of-technology knowledge-of-technology + ( 0.6 * knowledge-of-technology )  
                             set risk-aversion risk-aversion - ( 0.6 * risk-aversion )
                             set cultural-inertia cultural-inertia - ( 0.6 * cultural-inertia )
                             set extension-worker-contact true
                             
                             if ( random 4 >= 2 ) and ( soil-conservation-decision = "not_accepted" ) 
                             [ set soil-conservation-decision "accepted_not_adopted" 
                               set color blue 
                               set decisions-to-accept decisions-to-accept + 1 
                               ask my-farm [set soil-conservation-practised false ]]
                               ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;PLOTS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PLOTS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to my-update-plots
  
  set-current-plot "percentage of fields with SWC"
  set-current-plot-pen "percentage of fields with conservation"
  plot ((  ( count patches with [ soil-conservation-practised = true ])  / count patches ) * 100 )
  
  
  set-current-plot "percentage of farmers adopted SWC"
  set-current-plot-pen "default"
  plot (( count farmers with [ soil-conservation-decision = "adopted" ] ) / count farmers ) * 100
end 


;;;;;;;;;;;;;;;;;;;;;;;;index of dissimilarity;;;;;;;;;;;

to IoDiss
  ; D = 0.5(abs)sum(b/B - w/W), over the 4 areas.
   
   set DareaA ( ( count farmers with [ xcor >= 0 and ycor >= 0 and soil-conservation-decision = "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision = "adopted" ] )) - 
              ( ( count farmers with [ xcor >= 0 and ycor >= 0 and soil-conservation-decision != "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision != "adopted" ] ))
              
   set DareaB ( ( count farmers with [ xcor >= 0 and ycor < 0 and soil-conservation-decision = "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision = "adopted" ] )) - 
              ( ( count farmers with [ xcor >= 0 and ycor < 0 and soil-conservation-decision != "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision != "adopted" ] ))
              
   set DareaC ( ( count farmers with [ xcor < 0 and ycor < 0 and soil-conservation-decision = "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision = "adopted" ] )) - 
              ( ( count farmers with [ xcor < 0 and ycor < 0 and soil-conservation-decision != "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision != "adopted" ] ))
              
   set DareaD ( ( count farmers with [ xcor < 0 and ycor >= 0 and soil-conservation-decision = "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision = "adopted" ] )) - 
              ( ( count farmers with [ xcor < 0 and ycor >= 0 and soil-conservation-decision != "adopted" ] ) / 
                ( count farmers with [ soil-conservation-decision != "adopted" ] ))
              
   
   set IoD 0.5 * ( abs DareaA + abs DareaB + abs DareaC + abs DareaD ) 
end 

There are 6 versions of this model.

Uploaded by When Description Download
Peter Johnson about 10 years ago 20oct Download this version
Peter Johnson over 10 years ago More INFO tab updates Download this version
Peter Johnson over 10 years ago Further tidying Download this version
Peter Johnson over 10 years ago Updated interface Download this version
Peter Johnson over 10 years ago Tidied code for width Download this version
Peter Johnson over 10 years ago Initial upload Download this version

Attached files

File Type Description Last updated
The SWAP Model.png preview Preview for 'The SWAP Model' over 10 years ago, by Peter Johnson Download

This model does not have any ancestors.

This model does not have any descendants.