I have my turtles own
age as one of their variables and I have
age set to ticks so that my turtles age whenever they reach a certain number of ticks. However, this causes all turtles to age at the same time (say when ticks = 5), regardless of when they've been created.
Is there any way to get the age to start when the turtle is created? So if the turtle would be created at tick 5, its age starts at zero, but is still equal to the same length as 1 tick?
Yes! Sorry! Here is the code I've been playing with before I put it into my actual model
breed [kids kid] breed [adults adult] breed [elderlies elderly] turtles-own [age z] to setup clear-all create-kids 10 [setxy random-xcor random-ycor] set-default-shape kids "fish" create-adults 10 [setxy random-xcor random-ycor] set-default-shape adults "person" set-default-shape elderlies "cow" clear-output reset-ticks end to go ask kids [birthday move] ask adults [birthday reproduce-adults move] tick end to birthday set age ticks if age > 5 [set breed adults] if age > 10 [set breed elderlies] if age > 15 [die] end to reproduce-adults set z random 100 if z > 65 [ hatch-kids 1] end to move rt random 360 fd 1 end