>>4If danger === true {
+1 to aggression behavior;
}
unknown stimuli, how to respond {
aggression behavior is high, so respond with aggression;
}
ta-daa, it learned from past experiences, and applied it at a later date. This is also only a very basic application of learning and applying.
as for "change can vary to infinity" while this is true, and computers definitly can't do that, guess what? Nothing can. No living creater processes all of the changes occurring around us, let alone every possible occurance, so how are you going to expect a computer to do it? Everything is reactive to stimuli, and while you cannot control every possible stimuli, you can control how you, or a computer reacts to it.
For example you can make a program like I've already said, where it recognizes a certain object, and then processes how to go about interacting with it. For example: Food object. Food was eaten, and it tasted good, thus food = good reaction. Spider. Spider lowered happiness, and raised pain once before, (these events can be "remembered" by storing the changes in a variable) so respond with fear.
as for instinct, all you have to do is program the parent, and then when those two parents "reproduce" have some of the behavioral variables be inherited by the child object. That's all instincts are, really.
example: Dad: aggression = 8, Mother: aggression = 2. Male offspring will tend to be inheritivly aggressive, and female offspring will tend to be less aggressive, or more frightful (depending on other variables)