# Globalisation after Corona Virus

Model was written in NetLogo 6.1.1
•
Viewed 47 times
•
Downloaded 0 times
•
Run 0 times

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

Info tab cannot be displayed because of an encoding error

## Comments and Questions

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

Click to Run Model

patches-own [work-environment prob ] turtles-own [skill probability skill-eff] ; made turtle-own variable so we can check probability links-own [active? strength offset] ; both migration buttons need to be turned off before running impact buttons otherwise migration keeps taking place to setup ;creates countries, gives work environment clear-all ask patches [ if ( pxcor < -5 and pycor < -5) [set pcolor yellow] if ( pxcor > 5 and pycor > 5) [set pcolor green] if ( pxcor < 6 and pycor < 6 and pxcor > -6 and pycor > -6) [set pcolor red] ] let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ;if area is less then work-environment sum will be less because work environment is per patch and small country has less patches set-current-plot "Work-Environment" set-current-plot-pen "Green" plot sum [work-environment] of patches with [pcolor = green] set-current-plot-pen "Red" plot sum [work-environment] of patches with [pcolor = red] set-current-plot-pen "Yellow" plot sum [work-environment] of patches with [pcolor = yellow] ask G [set work-environment 10] ask R [set work-environment 7.5] ask Y [set work-environment 2.5] end to life ; creates people, instructs turtles to randomly move to patches and set color according to what patch they are on, skill set as per distribution create-turtles 100 [ set shape "person" set skill random 100 ;creates people with randomly alotted skills set probability random-float 1 ] ask patches [ set prob random-float 1 ] let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ask turtles [move-to one-of patches with [pcolor = green or pcolor = yellow or pcolor = red]] ask turtles-on G [set color 54] ask turtles-on R [set color 14] ask turtles-on Y [set color 44] if colour? [ ask turtles with [skill > 80] [set color pink] ask turtles with [skill < 80 and skill > 50] [set color blue] ] reset-ticks end to go ; migration command let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ;Migrate from Yellow to Red if any? turtles-on Y [ ask one-of turtles-on Y [if skill > 80 [ if work-environment < 100 [ move-to one-of G ] ] ] ] if any? turtles-on Y [ask one-of turtles-on Y [if skill > 50 [ if work-environment < 50 [ move-to one-of R ]]]] ;migrate from red to green if any? turtles-on R [ask one-of turtles-on R [if skill > 80 [ if work-environment < 100 [move-to one-of G ]]]] ; let pop count turtles-on G ;ask patches [ask turtles-here [ if skill > 80 [set work-environment work-environment + 0.01]]] ;gradual increase in work environment from all good brains existing together ;ask patches [ask turtles-here [ if skill > 50 [set work-environment work-environment + 0.005]]] ;ask patches [ask turtles-here [ if skill < 25 [set work-environment work-environment - 0.005]]] ;gradual decrease in work environment from all bad brains existing together ;ask patches [ask turtles-here [ if skill < 10 [set work-environment work-environment - 0.01]]] end to impact let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ask turtles [ifelse [pcolor] of patch-ahead 1 != green [set heading heading - 100][fd 1]] ask turtles [ifelse [pcolor] of patch-ahead 1 != red [set heading heading - 100][fd 1]] ask turtles [ifelse [pcolor] of patch-ahead 1 != yellow [set heading heading - 100][fd 1]] ask R [ if any? (turtles-on patches with [pcolor = red]) [ set-current-plot "Avg-Skill" set-current-plot-pen "Red1" plot (sum [skill] of turtles-on patches with [pcolor = red]) / (count turtles-on patches with [pcolor = red]) set-current-plot-pen "yellow" plot (sum [skill] of turtles-on patches with [pcolor = yellow]) / (count turtles-on patches with [pcolor = yellow]) set-current-plot-pen "green" plot ((sum [skill] of turtles-on patches with [pcolor = green]) / (count turtles-on patches with [pcolor = green])) set-current-plot "Work-Environment" set-current-plot-pen "Green" plot sum [work-environment] of patches with [pcolor = green] set-current-plot-pen "Red" plot sum [work-environment] of patches with [pcolor = red] set-current-plot-pen "Yellow" plot sum [work-environment] of patches with [pcolor = yellow] ] ] skill-effects env-effect skill-share end ; create factor to corona let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ask patches [ set work-environment work-environment - 0.5 ] end to migration-post-corona let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ; if probability < travel-restriction ask one-of turtles-on Y [if probability < travel-restriction[if work-environment < 100[if skill > 80 [move-to one-of G]]]] ; ask one-of turtles-on Y [if probability > travel-restriction[if work-environment < 100[if skill > 80 [set color blue]]]] ; ask one-of turtles-on R [if probability < travel-restriction[if work-environment < 100[if skill > 80 [move-to one-of G]]]] ; ask one-of turtles-on R [if probability > travel-restriction[if work-environment < 100[if skill > 80 [set color blue]]]] ask one-of turtles-on Y [if probability < travel-restriction[if work-environment < 50[if skill > 50 [move-to one-of R]]]] ;ask one-of turtles-on Y [if probability > travel-restriction[if work-environment < 50[if skill > 50 [set color pink]]]] ; its moving based on others' probability have to make sure it moves on its own probability -- update: i think this is fixed end to life-after-corona let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] ; ask patches [ask turtles-here [ if skill > 80 [set work-environment work-environment + 0.01]]] ;ask patches [ask turtles-here [ if skill > 50 [set work-environment work-environment + 0.005]]] ;ask patches [ask turtles-here [ if skill < 25 [set work-environment work-environment - 0.005]]] ;ask patches [ask turtles-here [ if skill < 10 [set work-environment work-environment - 0.01]]] ;they keep increasing i dont know whats wrong ; green country has a good start because work environment is already very high but i dont see its low-skilled people affecting work-env like in other countries set-current-plot "Work-Environment" set-current-plot-pen "Green" plot sum [work-environment] of patches with [pcolor = green] set-current-plot-pen "Red" plot sum [work-environment] of patches with [pcolor = red] set-current-plot-pen "Yellow" plot sum [work-environment] of patches with [pcolor = yellow] set-current-plot "Avg-Skill" set-current-plot-pen "Red1" plot (sum [skill] of turtles-on patches with [pcolor = red]) / (count turtles-on patches with [pcolor = red]) set-current-plot-pen "yellow" plot (sum [skill] of turtles-on patches with [pcolor = yellow]) / (count turtles-on patches with [pcolor = yellow]) set-current-plot-pen "green" plot ((sum [skill] of turtles-on patches with [pcolor = green]) / (count turtles-on patches with [pcolor = green])) skill-effects env-effect ask turtles [ifelse [pcolor] of patch-ahead 1 != green [set heading heading - 100][fd 1]] ask turtles [ifelse [pcolor] of patch-ahead 1 != red [set heading heading - 100][fd 1]] ask turtles [ifelse [pcolor] of patch-ahead 1 != yellow [set heading heading - 100][fd 1]] skill-share end to skill-effects if skill-effect? [ ask patches [if prob < 0.1 [ask turtles-here [ if skill > 50 [set work-environment work-environment + ( skill / 1000)]]]] ask patches [if prob < 0.1 [ask turtles-here [ if skill < 50 [set work-environment work-environment - ( skill / 1000)]]]] ] end to skill-share let Y patches with [pcolor = yellow] let G patches with [pcolor = green] let R patches with [pcolor = red] if skill-sharing? [ ask turtles [ let own-multiplier skill * 0.00001 if ordinary?[ if any? turtles-on patch-here [ask turtles-on patch-here [if skill > 50 [ask turtles-on patch-here [set skill skill + own-multiplier]]]] if any? turtles-on patch-here [ask turtles-on patch-here [if skill < 50 [ask turtles-on patch-here [set skill skill - own-multiplier]]]] ] if lattice? [ ask turtles-on G [ if skill > 80 [ create-links-with up-to-n-of 3 other turtles-on G in-radius 2 [ set active? true set strength 1 set color white set offset random 3 ] ] ask turtles-on Y [ if skill > 80 [ create-links-with up-to-n-of 3 other turtles-on Y in-radius 2 [ set active? true set strength 1 set color white set offset random 3 ] ] ] ask turtles-on R [ if skill > 80 [ create-links-with up-to-n-of 3 other turtles-on R in-radius 2 [ set active? true set strength 1 set color white set offset random 3 ] ]] ask in-link-neighbors [if skill > 50 [set skill skill + own-multiplier]] ask in-link-neighbors [if skill < 50 [set skill skill - own-multiplier]] ] ] ] ] end to env-effect if environment-effect? [ ask turtles [ask patch-here [ if work-environment > 5 [ask turtles-here [set skill skill + (work-environment / 50 )]]]] ask turtles [ask patch-here [if work-environment < 5 [ask turtles-here [set skill skill - (work-environment / 50)]]]] ] end

There is only one version of this model, created 2 months ago by Massab Qayum.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

Globalisation after Corona Virus.png | preview | Preview for 'Globalisation after Corona Virus' | 2 months ago, by Massab Qayum | Download |

This model does not have any ancestors.

This model does not have any descendants.