mucus follower vs random locomotion

No preview image

1 collaborator

Default-person Yukio Matsumoto (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.3.1 • Viewed 71 times • Downloaded 9 times • Run 0 times
Download the 'mucus follower vs random locomotion' 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[males male]
breed[females female]
breed[mutant-females mutant-female]
globals[ X1 test_mutant_female test_female male_for_mutant male_for_female min_distance3_of_mutant_females min_distance3_of_females
  test_mutant_male test_male female_for_mutant female_for_male min_distance3_of_mutant_males min_distance3_of_males]

patches-own [mucus]

to setup

  __clear-all-and-reset-ticks
  setup-patch
  setup-abalone-mutantfemale
  setup-abalone-female
  setup-abalone-male

  reset-ticks
end 

to setup-patch
  ask patches [set pcolor 97]
end 

to setup-abalone-male
 create-males 1  [setxy random-xcor random-ycor]
 ask males [
 set pen-size 2
 set color blue
 set size 2

 ]
end 

to setup-abalone-female
create-females 1   [setxy random-xcor random-ycor]
ask females [
set pen-size 2
set color red
set size 2

]
end 

to setup-abalone-mutantfemale
create-mutant-females 1 [setxy random-xcor random-ycor]
ask mutant-females [
set pen-size 2
set color pink
set size 2

]
end 

;;;;;;;;;;;;;;;;;;;;;
;;; Go procedures ;;;
;;;;;;;;;;;;;;;;;;;;;

to go

  if ticks >= 30  [ stop ]

  set-mucus

  move-abalone
  disapper-of-mucus
  check-distance

  tick
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to set-mucus
  ask turtles [

   set mucus mucus *  0
   set mucus mucus + 1
    if (mucus > 0)
   [set pcolor gray]
   ]
end 

;;;;;;;;;;;;

to move-abalone

ask-concurrent  turtles with [ color = red or color = blue][
  set X1  random-gamma 0.618714 0.011419933
   repeat X1   [
   ifelse random 1 < 0 [rt random 360][lt random 360]
     forward 0.25  set mucus mucus *  0 set mucus mucus + 1 if (mucus > 0)
   [set pcolor gray]
]
]


ask-concurrent  turtles with [ color = pink or color = sky] [
    set X1    random-gamma 0.618714 0.011419933
   repeat X1   [
   ifelse random 1 < 0 [rt random 360][lt random 360]
     forward 0.25  set mucus mucus *  0 set mucus mucus + 1 if (mucus > 0)
   [set pcolor gray]
]
]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to disapper-of-mucus
  ask patches with [pcolor = gray][
  set mucus mucus - 1
  if (mucus < 0)
  [set pcolor 97]
   ]
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to check-distance

   set test_mutant_female one-of mutant-females
  set test_female one-of females
  set male_for_mutant  [min-one-of turtles with [color = blue or color = sky] [distance myself] ] of test_mutant_female
  set male_for_female  [min-one-of turtles with [color = blue or color = sky] [distance myself] ] of test_female


  let mutant-near_male_positiony  [ycor] of male_for_mutant
    let mutant-near_male_positionx  [xcor] of male_for_mutant
    let mutant-female_positiony  [ycor] of test_mutant_female
    let mutant-female_positionx  [xcor] of test_mutant_female

  let near_male_positiony  [ycor] of male_for_female
    let near_male_positionx  [xcor] of male_for_female
    let female_positiony  [ycor] of test_female
    let female_positionx  [xcor] of test_female


  set min_distance3_of_mutant_females (sqrt ( (mutant-near_male_positionx - mutant-female_positionx) ^ 2 +  ( mutant-near_male_positiony - mutant-female_positiony ) ^ 2))
  set min_distance3_of_females (sqrt ( (near_male_positiony - female_positiony) ^ 2 +  (near_male_positionx - female_positionx ) ^ 2))
end 

There is only one version of this model, created over 5 years ago by Yukio Matsumoto.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.