Landfill

Landfill preview image

1 collaborator

Default-person Hsiao Yang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 57 times • Downloaded 6 times • Run 0 times
Download the 'Landfill' 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

turtles-own [
  eat-timer
]

globals [ lettuce-molecules microorganism-molecules lettuce_index ]

breed [ lettuces lettuce ]
breed [ microorganisms microorganism ]
breed [ waters water ]
breed [ oxygens oxygen ]

to setup
  clear-all
  set-default-shape turtles "circle"

  set lettuce-molecules 160
  create-lettuces lettuce-molecules
  ask lettuces [ set color green ]
  ask lettuces [ set xcor 0 + random 5 set ycor 0 + random 5 ]

  set microorganism-molecules 1
  create-microorganisms microorganism-molecules
  ask microorganisms [ set color red ]
  ask microorganisms [ set shape "square" ]
  ask microorganisms [ setxy random-xcor random-ycor ]
  ask microorganisms [ set eat-timer 60 ]


  ;;set water-molecules 25
  create-waters water-percentage
  if water-percentage > 45 or water-percentage < 60 [
    ask waters [ set color blue ]
    ask waters [ setxy random-xcor random-ycor ]
  ]

  ;;set oxygen-molecules 25
  create-oxygens oxygen-percentage
  if oxygen-percentage > 5 [
    ask oxygens [ set color white ]
    ask oxygens [ setxy random-xcor random-ycor ]
  ]

  reset-ticks
end 

to setup-molecules [c]
  ;set ready-timer 0
  set color c
  setxy random-xcor random-ycor
end 

to go
  if (any? lettuces = false) [stop]
  ask microorganisms [
    let food one-of lettuces-here
    ifelse food = nobody [
      move
    ]
    [
      if (ticks mod 60 = 0) [
        ask food [ die ]
        set eat-timer 60
      ]
    ]
  ]

  ask microorganisms [decrement-timer]
  tick
end 

to move
  set lettuce_index 1
  while [any? lettuces] [
    ifelse lettuce lettuce_index != nobody [
      face lettuce lettuce_index
      fd 1
      stop
    ]
    [
      set lettuce_index lettuce_index + 1
    ]
  ]
end 

to decrement-timer
   set eat-timer eat-timer - 1
end 

There is only one version of this model, created over 3 years ago by Hsiao Yang.

Attached files

File Type Description Last updated
Landfill.png preview Preview for 'Landfill' over 3 years ago, by Hsiao Yang Download

This model does not have any ancestors.

This model does not have any descendants.