Find a Partner
No preview image
Model was written in NetLogo 5.0RC7
•
Viewed 408 times
•
Downloaded 20 times
•
Run 0 times
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
globals [ ;p-increase scope ] turtles-own [ picky ;allowable distance between your average scores ability ;how smart you are popularity ;how cool you are no-match? ;if you have a partner or not...true = no partner, false = partner buddy ] links-own[ av-ability av-pop dif-ability dif-pop ] to setup clear-all reset-ticks let yrepeat 2 let xrepeat 2 let yoffset 6 let xoffset -10 repeat rows [ repeat columns [ create-turtles 1 [ ;;one of Nathan's suggestions was to put them into 'desk' formation, it made it easier to have them pick a turtle set shape "person" set ycor (yrepeat + yoffset) set xcor (xrepeat + xoffset) set xrepeat (xrepeat + 2) set picky 0 set ability random 10 set popularity random 10 set no-match? true set color scale-color 40 (ability + 1) 0 10];sets the color of the turtles according to ability level. ;The first number is the color that is shaded ] set yrepeat (yrepeat - 2) set xrepeat 2 ] ;set p-increase .1 set scope 2 end to go if all? turtles [no-match? = false] [stop] ask turtles [ set picky (picky + p-increase) ] ask turtles [ if no-match? ;ifelse no-match? [find-partner] ;true - search for partners ;[set shape "face happy"] ;false - have a partner, change shape is just so we can see it for now ] set scope (scope + 2) ;look further out for a partner tick end to find-partner let close-turtle one-of other turtles with [distance myself <= scope and no-match? = true] ;pick one that's close and doesn't already have a partner let your-score (([ability] of close-turtle + [popularity] of close-turtle) / 2) let my-score ((ability + popularity) / 2) if abs (your-score - my-score) <= picky ;this should be the same for both, right? they should each have the same pickyness, and the abs difference between their mean scores should be the same? [set no-match? false ;I have a partner set buddy close-turtle ;sets who the turtle's partner is ask close-turtle [ ;you have a partner set no-match? false set buddy myself] ;sets who the matched turtle's partner is ] ifelse no-match? = false and [no-match?] of close-turtle = false ;if we are both ok with matching [partner] ;then we become partners and do something TBD [set no-match? true ask close-turtle [set no-match? true] ] ;if not, we both go back to being partnerless end to partner ;set color black this is a place holder - still need to figure out what we want them to do. half of them turn black and their partner becomes a smiley face in the go procedure ;;maybe they could draw a line to their partner? what would be a useful thing to see? ;move-to buddy ;fd 1 set shape "face happy" create-link-with buddy ask link-with buddy [set av-ability (([ability] of end1 + [ability] of end2) / 2) set av-pop (([popularity] of end1 + [popularity] of end2) / 2) set dif-ability abs (([ability] of end1 - [ability] of end2) / 2) set dif-pop abs (([popularity] of end1 - [popularity] of end2) / 2) set color scale-color 111 (dif-ability + 1) 7 0 ] ;links with greater difference in ability are darker colors ;sets background color according to average ability + popularity set pcolor scale-color 90 ((ability + [ability] of buddy + 1) / 2) 0 10 ;lighter blue means higher average ability ask buddy [ set pcolor scale-color 20 ((popularity + [popularity] of buddy + 1) / 2) 0 10 ;lighter orange means higher average popularity set shape "face happy" ] end to-report number-paired report count turtles with [no-match? = false] ;histogram-from links [dif-ability] ;histogram-from links [dif-popularity] end ;;do we want to add any sliders?
There is only one version of this model, created almost 13 years ago by Stina Krist.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.