⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 !!!---cooperation2.nlogo

📁 NETLOGO
💻 NLOGO
字号:
turtles-own [energy  c-type]patches-own [ grass temp ]globals [num-coop num-greed];breeds [ coop greed]to setup	ca	ask patches [		set grass max-grass		color-grass	]	crt number-coop + number-g	ask turtles [		set c-type random 2 ;; set the breed		;create-coop number-coop		;create-greed number-g		ifelse (c-type = 0 )			[setc pink]			[setc blue]		setxy random 2000 random 2000		set energy metabolism * 4	]    set-plot-pen "coop"	set-plot-pen-color pink	set-plot-pen "greed"	set-plot-pen-color blue	set-plot-x-range 0 1	set-plot-y-range 0 1	auto-plot-onendto go	ask turtles [		ifelse c-type = 0		[			move			eat-coop			reproduce		]		[			move			eat-greed			reproduce		]	]	ask patches [		grow-grass		color-grass	]    set num-coop 0    set num-greed 0    ask turtles [ ifelse c-type = 0 [ set num-coop num-coop + 1][set num-greed num-greed + 1] ]    set-plot-pen "coop"	plot num-coop	set-plot-pen "greed"	plot num-greedendto reproduce	if(energy > rep-level)[		set energy energy - rep-cost		hatch[]		ifelse (c-type = 0)		[		   ;if ((random 100) < 1)				;	 [setbreed greed]   		 ;if (breed = greed)	  	;[ask greed [setc blue]]      	;ask coop [setc pink]			setc pink		]		[		   ;if ((random 100) < 8)			;	 [setbreed coop]			 ;  if (breed = coop)	 	 	;[ask coop [setc pink]]			;ask greed [setc blue]			setc blue		]	]endto grow-grass		set temp l-h-thresh		ifelse ( grass >= temp)[			if(h-g-chance >= (random 100))[					set grass grass + 1			]		][			if(l-g-chance >= (random 100))[					set grass grass + 1			]		]		if(grass > max-grass ) [set grass max-grass]endto color-grass	scale-pc green grass 0 (2 * max-grass)endto move	fd 1 / viscosity	seth random 360	set energy energy - metabolism	if (energy < 0) [die]endto eat-coop	if(grass > l-h-thresh )[		set grass grass - 1		set energy energy + grass-energy	]endto eat-greed	if(grass > 0)[		set grass grass - 1		set energy energy + grass-energy	]end@#$#@#$#@CC-WINDOW10262307437DefaultBUTTON671011937gogoT1TOBSERVERBUTTON995837setupsetupNIL1TOBSERVERSLIDER1406025797number-coopnumber-coop0.0100.06.01.01SLIDER76011693number-gnumber-g0.0100.06.01.01SLIDER139210270242l-h-threshl-h-thresh0.099.05.01.01SLIDER139138270167h-g-chanceh-g-chance0.099.075.01.01SLIDER1421825452viscosityviscosity1.020.012.01.01SLIDER139174270204max-grassmax-grass0.040.010.01.01SLIDER4209127241rep-levelrep-level0.0200.0101.01.01SLIDER5139129168grass-energygrass-energy0.0200.051.01.01SLIDER6102130134metabolismmetabolism0.099.010.01.01SLIDER139101270133l-g-chancel-g-chance0.099.030.01.01PLOT49531744230plot1xAxisyAxisSLIDER6174129202rep-costrep-cost0.099.040.01.01GRAPHICS-WINDOW2842748823112128.161@#$#@#$#@WHAT IS IT?-----------This is an evolutionary biology model.  In it, different breeds of cows compete for natural resources. Individuals that are more successful in getting the resources will reproduces more often, and will thus be more evolutionarily successful.There are two breeds of agents: greedy and cooperative cows. Every turn, each cow looks at the patch that it is currently on, and eats a unit of grass.  The greedy cows eat the grass regardless of the length of the grass on the current patch.  The cooperative cows won't eat the grass below a certain height.  This behavior is significant because below a certain height (called the 'growth threshold') the grass grows at a far slower rate than above it.  Thus, the cooperative agents leave more food for the overall population at a cost to their individual well-being, while the greedy agents eat the grass down to the nub, regardless of the effect on the overall population.HOW TO USE IT?--------------GO: Starts and stops the model.SETUP: Resets the simulation according to the parameters setby the sliders.NUMBER-G: Sets the number of greedy cows.NUMBER-COOP: Sets the number of cooperative cows.VISCOSITY: This value determines the limitations on the movement of the cows.  At a value of 0 or 1, each cow moves forward 1 each turn.  As the value is increased, the cows are limited to a fraction of their movement.  This value is the denominator of that fraction; thus, the higher the viscosity, the less the mobility of the cows.  The term 'viscosity' derives from imagining a thick or viscous fluid as the medium through which the agents must move.GRASS-ENERGY: Each time a cow can each some grass from the patch that it currently occupies, it increases its energy by the value of this slider.METABOLISM: Every turn, each cow loses the amount of energy set by this slider.  If the cows energy reaches 0, it dies.  Every cow starts with a default energy of 50, which means it can go five turns without eating.REP-LEVEL: If a cow's energy reaches the value of this slider, it reproduces.  This value represents the food-gathering success that a cow would have to have in order to be able to reproduce.REP-COST: Each time a cow reproduces, it loses the amount of energy set by this slider.  This value represents the energy cost of reproduction.L-G-CHANCE: This value is the percentage chance that the grass below the growth threshold will grow back.  The higher this value, the less the descrepancy between the behaviors of the cooperative and greedy cows.H-G-CHANCE: This value is the percentage chance that the grass above the growth threshold will grow back.  The lower this value, the less the descrepancy between the behaviors of the cooperative and greedy cows.MAX-GRASS:  This value sets the highest length to which the grass can grow.L-H-THRESH:  This value sets the growth threshold.  At, or above this value, the grass grows back with H-G-CHANCE.  Beclow this value, the grass grows back with L-G-CHANCE.THINGS TO NOTICE----------------Using the default settings, notice how the greedy (blue) cows quickly take over the world.  Look at the number of cooperative versus greedy agents. Also, look at the different growth habits on the graph.  Which population expanded first?THINGS TO TRY-------------Slowly increase the VISCOSITY slider.  What happens to the graph?  What happens to the populations?At what value of VISCOSITY do the populations' growth rates change dramatically?  What does this indicate about the evolutionary advantages of Cooperating versus being Greedy?  What are the important environmental factors?Change the METABOLISM and the GRASS-ENGERY values.  How do these values affect the model?Change the L-G-CHANCE and the H-G-CHANCE values.  How do these values affect the model?How does the L-H-THRESH value affect the growth of the populations?EXTENDING THE MODEL-------------------This model explores only one type of cooperative behavior, namely eating the grass above the growth threshold (the L-H-THRESH value).  What other cooperative, or altruistic, behaviors could be modeled that hurt individual fitness, while helping the group overall?  What other environmental conditions than grass length could be used to effect the health of a population?This model relies primarily upon population viscosity (the VISCOSITY slider) to alter the behavior of the cows to allow for the success of the cooperative agents.  What other variables could have such a drastic effect on the evolutionary success of populations?Also, consider that in this model the behaviors are fixed.  What would happen if the agents learned, or changed their behavior based on food availability?RELATED MODELS--------------Altruism (Trait) Model@#$#@#$#@arrowtrue0Polygon -7566196 true true 150 300 300 150 195 150 195 7 105 7 105 150 105 150 0 150boxtrue0Polygon -7566196 true true 45 255 255 255 255 45 45 45defaulttrue0Polygon -7566196 true true 150 5 40 250 150 205 260 250spacecrafttrue0Polygon -7566196 true true 150 300 120 165 45 45 75 60 150 120 225 60 255 45 180 165thin-arrowtrue0Polygon -7566196 true true 150 300 300 150 180 150 180 4 120 4 120 150 120 150 0 150turtletrue0Polygon -7566196 true true 138 75 162 75 165 105 225 105 225 142 195 135 195 187 225 195 225 225 195 217 195 202 105 202 105 217 75 225 75 195 105 187 105 135 75 142 75 105 135 105personfalse0Circle -7566196 true true 155 20 63Rectangle -7566196 true true 158 79 217 164Polygon -7566196 true true 158 81 110 129 131 143 158 109 165 110Polygon -7566196 true true 216 83 267 123 248 143 215 107Polygon -7566196 true true 167 163 145 234 183 234 183 163Polygon -7566196 true true 195 163 195 233 227 233 206 159truck-downfalse0Polygon -7566196 true true 225 30 225 270 120 270 105 210 60 180 45 30 105 60 105 30Polygon -8716033 true false 195 75 195 120 240 120 240 75Polygon -8716033 true false 195 225 195 180 240 180 240 225truck-rightfalse0Polygon -7566196 true true 180 135 75 135 75 210 225 210 225 165 195 165Polygon -8716033 true false 210 210 195 225 180 210Polygon -8716033 true false 120 210 105 225 90 210truck-leftfalse0Polygon -7566196 true true 120 135 225 135 225 210 75 210 75 165 105 165Polygon -8716033 true false 90 210 105 225 120 210Polygon -8716033 true false 180 210 195 225 210 210circletrue0Circle -7566196 true true 34 34 230@#$#@#$#@NetLogo 1.0 Beta 5@#$#@#$#@@#$#@#$#@@#$#@#$#@

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -