---primordial_turtles9.nlogo
来自「NETLOGO」· NLOGO 代码 · 共 62 行
NLOGO
62 行
; Primordial Turtles!; Here how it works:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;; SETUP VARIABLES AND PARAMETERS ;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;globals [ g-x-pref ; The preferential x-coordinate where the the grass will grow g-y-pref ; The preferential y-coordinate where the the grass will grow b-x-pref ; The preferential x-coordinate where the the berries will grow b-y-pref ; The preferential y-coordinate where the the berries will grow turtle-count ; The total number of turtles ticks ; The number of times through energy-from-berries; How much energy lost from eating poison berries berries-grow-rate ; How fast the berries grow ave-intelligence ; The average intelligence of all turtles ave-energy ; The average energy of all turtles ave-carnivorous ; The average 'carnivorous' of all turtles. Higher 'carnivorous' means more preference to meat ave-speed ; The average 'speed' of all turtles. This is how many patches the turtle can move per turn ave-aggresive ; The average aggresiveness of all turtles. ave-size ; The average size of all turtles ave-sight ; The average radius of vision (measured in patches) of all turtles. ave-age ; The average age (measured in ticks) of all turtles ave-repro-thresh ; The average reproduction threshold of all turtles. This is the amount of energy needed before it will reproduce ave-fight-tools ; The average 'fight-tools' of all turtles. These could be things like teeth, claws, and fighting skills. wolves ; The total number of turtles with a wolf shape. Defined as having 'carnivorous' > 0.66 sheep ; The total number of turtles with a sheep shape. Defined as having 'carnivorous' < 0.33 other ; The total number of turtles with the default shape. Defined as having 'carnivorous' > 0.33 and < 0.66 grass-patches ; The total number of patches with grass oldest ; The turle that has been around for the longest mutants ; The number of turtles born during nuclear fallout wanders ; The total number of times turtles have wandered grass-eaten ; The total number of times turtles have eaten grass fights ; The total number of turtle fights graphics-counter ; Used for numbering the graphics frames]turtles-own[ actions ; number of actions the turtle can do per turn age ; number of ticks the turtle has been around (range: >= 0) aggresive ; high aggresive means turtle is more likely to attack other turtles (usual range: 0-1) berries-eaten ; the number of times the turtle has eaten berries (range: >= 0) carnivorous ; the degree to which the turtle prefers meat. 0 means only likes grass. 1 means only likes (to eat) other turtles (usual range: 0-1) chasing? ; is this turtle after another? (range: true or false) color-digit ; The represents the base color of the turtle (range: 1, 2, or 4). It is an indication of aggresiveness energy ; The total amount of energy the turtle has. < 0 and turtle dies (range: > 0) fighting? ; Is the turtle fighting? (range: true or false) fight-partner ; Who is the turtle going to fight? fight-tools ; things such as teeth, claws, and power (usual range: 0-1) food-storage ; the amount of food (energy) can a turtle hold (range: > 0) intelligence ; how smart is the turtle (how logical its decisions are) (usual range: 0-1) likeness ; how similar a turtle is to a potential fight partner. This only has relevance in attacking situations move ; how far the turtle has moved this turn reproduction-threshold ; at what energy level will the turtle reproduce (range: > 0) sight ; the number of patches the turtle can see (range >= 0) speed ; number of patches a turtle can move each turn (usual range: 0-1) wander-strength ; how much influence does 憌ander direction
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?