Chloride Corrosion 1

No preview image

1 collaborator

Default-person Manu Pouose (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 42 times • Downloaded 6 times • Run 0 times
Download the 'Chloride Corrosion 1' 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 [ chlorides chloride]
breed [ moistures moisture]

to setup
  clear-all
  ask patches [if (pxcor > 0) [set pcolor grey]]
  ask patches [if (pxcor < 32) and (pxcor > 17) [set pcolor blue]]
  ask patches [if (pxcor < 18) and (pxcor > 15) [set pcolor orange]]
end 

to go
generate
move
end 

to generate
  create-chlorides 3
    [
    set shape "circle"
    set color yellow
    set size 1
    setxy -100 random-ycor
  ]

  create-moistures 5
    [
    set shape "circle"
    set color cyan
    set size 1
    setxy -100 random-ycor
  ]
end 

to move
  ask chlorides [ If (any? Patches with[ pcolor = grey] and (color = yellow))
    [set heading towards one-of patches with[ pcolor = grey ] fd 4]]
  ask moistures [ If (any? Patches with[ pcolor = grey] and (color = cyan))
    [set heading towards one-of patches with[ pcolor = grey ] fd 4]]


  ask chlorides [if pcolor = grey [set color yellow + 1]]
  ask moistures [if pcolor = grey [set color cyan + 1]]


  ask chlorides [ If (any? Patches with[ pcolor = orange] and (color = yellow + 1))
    [set heading towards one-of patches with[ pcolor = orange ] fd 1]]
  ask moistures [ If (any? Patches with[ pcolor = orange] and (color = cyan + 1))
    [set heading towards one-of patches with[ pcolor = orange ] fd 1]]


  ask patches [if pcolor = orange and (count chlorides in-radius 2 > 0 ) and (count moistures in-radius 2 > 1) [set pcolor brown]]

  ask turtles [ If (any? Patches with[ pcolor = brown])
    [set heading towards one-of patches with[ pcolor = brown ] fd 3]]

  ask patches [if pcolor = brown and (count moistures in-radius 2 > 2) [ask neighbors [if pcolor = blue [set pcolor brown]]]]
  ask patches [if pcolor = brown and (count moistures in-radius 2 > 2) [ask neighbors [if pcolor = orange [set pcolor brown]]]]

  ask patches [if pcolor = brown and (random 100 < 30) [ask neighbors [if pcolor = grey [set pcolor brown]]]]
  ask patches [if pcolor = brown and (random 100 < 90) [ask neighbors in-radius 20 [if pcolor = black [set pcolor grey]]]]
end 

to clearions
  ask turtles [die]
end 

There is only one version of this model, created 11 months ago by Manu Pouose.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.