behavior -------- all ants come pre-programed to seek and follow certain kinds of objects. the initial weights of wander, panic and follow are determined at birth randomly or according to a `most optimal' list ants die after N moves if they don't return to the nest; ants will only return to the nest if they find what they are looking for the nest has a list of objects, both specific and classes that are to be searched for; each ant may contain a copy of this list or any part of it, depending on a memory attribute ants keep track of a path back to the nest, but if they become trapped they will die. the nest keeps track of all the active ants and spawns a new ant whenever a) an ant dies of starvation (based on a fertility %) or b) a time threashhold is reached with no new deaths (ie, successful colonies grow more quickly) scent objects keep track of ant movements; when an ant is returning to the nest with an object, another ant can follow that trail to the source of the object. when an object causes an ant to enter panic, a panic scent reflecting the level of the ant's panic is deposited. Scents decay. depending on how paniced, an ant may drop an object when it becomes so. behavior tree ------------- wander causes ant to move randomly weighted by scents and objects --affected-- has a fixed weight scent - in room and neighbors | *-enter `panic' *-enter `flee' *-enter `follow' *-drop object object - " | *-enter `panic' *-enter `flee' *-enter `follow' *-enter `lift and carry to home' *-drop object wander_panic cuases ant to move quickly (two rooms or more at a time), ignoring scents --affected-- time passage causes weight to fall gradually wander_flee cuases ant to move semi-randomly away from a scent or object --affected-- proximity to object, as the ant gets farther away, the weight of this behavior drops wander_follow causes ant to move toward an object it has had contact with and continue to follow it --affected-- gradually drops after the passage of time. if the followed object is too far away, weight drops dramaticly lift and carry home causes ant to take an object and return to it's nest, following its internal navigation guide --affected-- reaching home causes object to be dropped and weight returns to 0