Rabbit-Evolution

No preview image

1 collaborator

Default-person bosmat bar (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.1 • Viewed 56 times • Downloaded 7 times • Run 0 times
Download the 'Rabbit-Evolution' modelDownload this modelEmbed this model

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

; reproduction of rabbits
; create 2 breeds-- girl rabbit and boy rabbit

breed [ boyrabbits a-boyrabbit ]
breed [ girlrabbits a-girlrabbit ]

globals [ clock
          boolean
          max-rabbits
        ]

turtles-own [ age ]                       ;rabbit has attribute of age

to setup                                  ;clear all and set rabbits randomaly by user choise
  clear-all
  ask patches [ set pcolor green ]
  ifelse netlogo-web? [ set max-rabbits 1500 ] [ set max-rabbits 1500 ] ;limit the max rabbits of the model
  create-boyrabbits מספר-ארנבים-התחלתי     ;create the male rabbits, then sets their intial variables
  [
    set color blue set shape "rabbit" set age 1 + random 5 fd random 35 rt random-float 360 set size ( age-size )
  ]
  create-girlrabbits מספר-ארנבות-התחלתי    ;create the female rabbits, then sets their intial variables
  [
    set color pink set shape "rabbit" set age 1 + random 5 fd random 35 rt random-float 360 set size ( age-size )
  ]
  set clock 0
  reset-ticks
end 

to go
 every 0.2                                 ;slow down the model
 [
 ask turtles
     [
        move                               ;wander around and look for a pet or rabbit (of the opposite gender)
        wiggle
        grow-older
        pass-away
     ]
     if count turtles = 0                 ;if we don't have any turtles left, we stop the model
        [ stop ]
     reproduce
     oestrum
     set clock clock + 1
 ]
 if count turtles > max-rabbits [ user-message "הארנבים השתלטו על העולם!" stop ]
end 

to-report age-size                        ;if the age is 10 or older, the size will stay 3
  ifelse (age < 10) [ report 1 + age * 0.2 ] [ report 3 ]
end 

to grow-older                              ;rabbits grow up
  set age age + 1                          ;rabbit''s size will grow as the rabbits grow older
  set size ( age-size )
end 

to wiggle                                  ;they move left and right, here and about
  left random 30
  right random 30
end 

to move
  forward random 2
end 

to oestrum                                   ;every female rabbit has a cycle of oestrum, visualized with the color yellow
  ask girlrabbits
  [ ifelse  ((age = 14) or (age = 17) or (age = 20) )
  [set color yellow][set color pink]]
end 

to reproduce                                 ;every female rabbit can reproduce if she meets few conditions: mature, in oestrum and in the "neiboughrood" of a male rabbit
  ask girlrabbits with [ age > 5 and  color = yellow and (any? boyrabbits in-radius 17 ) ]
    [ hatch (1 + random 2)                   ;she hatches between 1 to 3 baby-rabbits
      [
          set age 0
          set shape "rabbit"
          set size age-size
          ifelse random 2 = 0                ;chance of 1/3 for a boy. 2/3 for a girl
             [ set breed boyrabbits
               set color blue
               set shape "rabbit"
             ]
             [ set breed girlrabbits
               set color pink
               set shape "rabbit"
             ]
         lt random 180                        ;the baby-rabbits wander away, as the way of growing up offsprings
         fd random 5
       ]
     ]
end 

to pass-away
  if (age > 21 ) [ die ] ;a rabbit pass away after age of 31. we set the n-dead in case we want to show it
end 


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

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.