Child of Fitness Landscapes
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
## WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
## HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
## HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
## THINGS TO NOTICE
(suggested things for the user to notice while running the model)
## THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
## EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
## NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
## RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
## CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
breed [ stayers stayer ] ;; static turtles breed [ walkers walker ] ;; dinamic turrtles globals[t meanfit max-elevation] walkers-own [fitness] stayers-own [f2] to setup clear-all ask patches with [pzcor = 0] [ sprout-stayers 1 [ create-links-with turtles-on neighbors4 ht ;; make the turtle invisible ] ] end to mini-setup ask walkers [die] clear-plot reset-ticks end to create-random-peak [optimx optimy altura gruix] ask stayers [ set f2 f2 + altura * exp ( (-1) * ( ( (xcor - optimx) * (xcor - optimx) + (ycor - optimy) * (ycor - optimy) ) / gruix ) ) ] end to setup-peak ask stayers with [pxcor = max-pxcor or pxcor = min-pxcor or pycor = max-pycor or pycor = min-pycor] [set f2 0] set max-elevation max [f2] of stayers ask stayers [ set zcor (f2 / max-elevation) * ( max-pzcor - 10 ) ;;elevate the points (stayers) ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;LANDSCAPES;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to create-one-peak ask stayers [set f2 0] create-random-peak random-xcor random-ycor height width setup-peak end to create-two-peaks ask stayers [set f2 0] create-random-peak random-xcor random-ycor height width create-random-peak random-xcor random-ycor height width setup-peak end to landscape1 ask stayers [set f2 0] repeat 10 [ create-random-peak random-xcor random-ycor random-float 1 random-float 30 ] setup-peak end to landscape2 ask stayers [set f2 0] repeat 10 [ let r1 random-xcor let r2 random-ycor let h1 random-float 1 let w1 random-float 150 create-random-peak r1 r2 h1 w1 ;show r1 ;show r2 ;show h1 ;show w1 ] setup-peak end to landscape3 ask stayers [set f2 0] create-random-peak random-xcor random-ycor 1 10 create-random-peak random-xcor random-ycor 0.7 30 create-random-peak random-xcor random-ycor 0.6 40 create-random-peak random-xcor random-ycor 0.4 40 create-random-peak random-xcor random-ycor 0.2 40 setup-peak end to landscape4 create-random-peak 15 15 1 40 create-random-peak -15 -15 1 40 create-random-peak 15 -15 1 40 create-random-peak -15 15 1 40 setup-peak end to setup-flattest create-random-peak 10 0 0.3 600 create-random-peak -15 0 1 6 setup-peak end ;; Crear les tortugues to crear-elements ask n-of num-turtles stayers[ hatch-walkers 1 [ st set color red set shape "circle" ] ] reset-ticks end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to p1 repeat 50 [ create-random-peak random-xcor random-ycor 1 50 ] setup-peak end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;IMPLEMENTATION;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to random-walk ask walkers [ let here one-of stayers-here let there one-of [link-neighbors] of here move-to there ] end to algoritm ask walkers [ set fitness sum [f2] of stayers-here ] set meanfit mean [fitness] of walkers let survivor turtle-set (walkers with [fitness >= meanfit]) let extinct turtle-set (walkers with [fitness < meanfit]) ask extinct [ if random-float 1 < probcol;; the turtle die [ let a one-of stayers setxyz [xcor] of a [ycor] of a [zcor] of a ] if random-float 1 < 1 - probcol;;the mother turtle has a "baby" [ if count survivor != 0 [ let b one-of survivor let c stayers with [ xcor = [xcor] of b and ycor = [ycor] of b and zcor = [zcor] of b ] move-to one-of [link-neighbors] of one-of c ] ] ] end to go if ticks = 1000 and j300 [stop] tick repeat evolutive-speed [random-walk] algoritm set-current-plot-pen "pen-1" plotxy ticks meanfit end
There is only one version of this model, created over 10 years ago by Joan Puig.
Attached files
No files
Parent: Fitness Landscapes
This model does not have any descendants.
John Dong
How does it work?
Hi Joan, thanks very much for sharing this great model. I tried to run it in NetLogo 6.2 but it doesn't work. Could you kindly let me know how I can solve the problem? Thanks a lot!
Posted almost 4 years ago