Fish Pair Interactions - Conformity and Aggression

Fish Pair Interactions - Conformity and Aggression preview image

1 collaborator

Default-person Vishwanath Varma (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.0 • Viewed 98 times • Downloaded 14 times • Run 0 times
Download the 'Fish Pair Interactions - Conformity and Aggression' 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 [ speed
  neighbor
  plasticity
  aggression
  a-countdown
]

breed [ fishes fish ]

to setup
  clear-all
  reset-ticks
  create-fishes 1
  [
    set size 2
    set speed boldness1 + random-normal 0 0.1
    set a-countdown 0
    ifelse boldness1 = 1 [
      set plasticity 0.005 + random-normal 0 0.001 ]
    [ set plasticity 0.0035 + random-normal 0 0.001 ]
    setxy random-xcor random-ycor
  ]

  create-fishes 1
  [
    set size 2
    set speed boldness2 + random-normal 0 0.1
    set a-countdown 0
    ifelse boldness2 = 1 [
      set plasticity 0.005 + random-normal 0 0.001 ]
    [ set plasticity 0.0035 + random-normal 0 0.001 ]
    setxy random-xcor random-ycor
  ]
end 

to go
  ask turtles [
    set neighbor one-of other turtles
    move
    chase-escape
    change-speed
  ]
  tick
end 

to move
  rt random 20
  lt random 20
  fd 1 * speed
end 

to chase-escape
  if distance neighbor < 5 and [ speed ] of self > [ speed ] of neighbor and a-countdown < 0 [
      set heading towards neighbor
      fd 1.5
      set aggression 1
      set a-countdown 10
  ]
  if distance neighbor < 3 and [ speed ] of self < [ speed ] of neighbor
    [ set heading [heading] of neighbor + random-normal 90 25
      fd 2
      set aggression 0 ]
  if distance neighbor > 5
    [ interact ]

  set a-countdown a-countdown - 1
end 

to interact
  if distance neighbor > 10 and any? other turtles in-cone 10 60 [
    set heading towards neighbor
    set heading heading + random-normal 0 20 ]
  if distance neighbor < 10
  [ set heading [heading] of neighbor + random-normal 0 20 ]
end 

to change-speed
  if distance neighbor < 5 [
    set speed speed + ([ speed ] of neighbor - [ speed ] of self) * plasticity + random-normal 0 0.001 ]

  if ([ speed ] of neighbor < [ speed ] of self) and distance neighbor < 10 [
    set speed speed + plasticity + random-normal 0 0.001
]
  if speed > 2 [
    set speed 2 ]
  if speed < 1 [
    set speed 1 ]
end 

There is only one version of this model, created over 4 years ago by Vishwanath Varma.

Attached files

File Type Description Last updated
Fish Pair Interactions - Conformity and Aggression.png preview Preview for 'Fish Pair Interactions - Conformity and Aggression' over 4 years ago, by Vishwanath Varma Download

This model does not have any ancestors.

This model does not have any descendants.