Pocket Mouse

Pocket Mouse preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (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.1.0 • Viewed 305 times • Downloaded 8 times • Run 0 times
Download the 'Pocket Mouse' 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 [energy]

to-report Time-period
  report ticks / 40
end 

to setup
  clear-all
  setup-turtles
  setup-patches
  reset-ticks
end 

to setup-turtles
  create-turtles 30
  ask turtles [
    set color 37.7 - random-float (Mutation-rate / 2)
    set shape "mouse side"
    set size 1.25
    setxy random-xcor random-ycor
    set energy 20]
end 

to setup-patches
  ask patches [set pcolor Environment-color]
end 

to go

  if years = 0 [user-message "Number of years is needed" stop]
  if ticks > years * 40 [stop]


  if color-heritable? = false [ask turtles [set color 31 + random-float 7.5]]
  diff-survival
  move
  forage
  dead
  reproduce
  regrow
  if count turtles = 0 [user-message "All mice have died."  Stop]
  tick
end 

to move
  ask turtles [rt (random 180)
               fd 1
               set energy energy - 1]
end 

to dead
  ask turtles [if energy <= 0 [die]]
end 

to forage
  ask turtles [if pcolor = Environment-color [set energy (energy + 1.5) set pcolor pcolor - 1]]
end 

to reproduce
  ask turtles [
    if energy >= 40
    [hatch 1
      [set energy 20
       if random 100 < Mutation-rate [
          ;set color (color - 1) + random-float 2
          set color 31 + random-float 7.5
        ]
        if color < 31 [set color 31]
        if color > 38.5 [set color 38.5]]
      set energy energy - 20
      ] ]
end 

to regrow
  ask patches with [pcolor != Environment-color] [set pcolor Environment-color]
end 

to diff-survival
    ask turtles [
      if random 2500 < (abs (color - Environment-color) * Number-of-visual-predators * 0.5) [die]
    ]
end 

There are 7 versions of this model.

Uploaded by When Description Download
lin xiang about 1 month ago Adjust X axis Download this version
lin xiang about 1 month ago Add in standard deviation Download this version
lin xiang about 1 month ago Adjust the slider length Download this version
lin xiang about 1 month ago adjust the selection pressure and add plots Download this version
lin xiang 4 months ago users may determine the time Download this version
lin xiang 6 months ago update interface Download this version
lin xiang about 3 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Pocket Mouse.png preview Preview for 'Pocket Mouse' about 3 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.