Homophily

Homophily preview image

1 collaborator

Default-person Jiawei Fu (Author)

Tags

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

extensions[nw] 
globals[number-homophily]

to setup
  clear-all
  nw:set-context turtles links
  create-turtles 10 [
    set color one-of [yellow blue violet red]
    ]
  ask turtles [
    if != myself
  if color = yellow [create-link-with one-of turtles with [color = yellow]]
  if color = blue [create-link-with one-of turtles with [color = blue]]
  if color = violet[create-link-with one-of turtles with [color = violet]]
  if color = red [create-link-with one-of turtles with [color = red]]
  ]
  ;setxy random-xcor random-ycor
  set-default-shape turtles "circle"    
  ;make-node nobody
  ;make-node turtle 0     
  reset-ticks
end 

to go
  ask links [ set color gray ]
  ;make-node 
  ;find-partner
  tick
 ;if layout? [ layout ]
end 

;to make-node [old-node]  
  ;crt 1
 ; [
   ;setxy random-xcor random-ycor
   ;set color one-of [yellow blue violet red]
    ;ifelse any? old-node with [[color] of myself][
     ;!= nobody[
    ; [color] of old-node = [color] of myself[
      ;create-link-with old-node
      ; move-to old-node
    ;fd 8
    ;set number-homophily number-homophily + 1
    ;]
;]
;end

to-report find-partner
  report one-of turtles
end 

There is only one version of this model, created over 7 years ago by Jiawei Fu.

Attached files

File Type Description Last updated
Homophily.png preview Preview for 'Homophily' over 7 years ago, by Jiawei Fu Download

This model does not have any ancestors.

This model does not have any descendants.