Page 99 - Introduction to AI Robotics
P. 99

82
                                            flee();               3 Biological Foundations of the Reactive Paradigm
                                        food = senseFood();
                                        hungry = checkStateHunger();
                                        parent = checkStateParent();
                                        if (hungry==PRESENT)
                                            searchForFood();
                                        feed();
                                        nurse();
                                        sleep();
                                     }



                                       The explicit sequence at first may be more appealing. It is less cluttered
                                     and the compound releasers are hidden. But this implementation is not
                                     equivalent. It assumes that instead of the loop executing every second and
                                     the behaviors acting incrementally, each behavior takes control and runs to
                                     completion. Note that the agent cannot react to a predator until it has fin-
                                     ished the sequence of behaviors. Calls to the fleeing behavior could be in-
                                     serted between each behavior or fleeing could be processed on an interrupt
                                     basis. But every “fix” makes the program less general purpose and harder to
                                     add and maintain.
                                       The main point here is: simple behaviors operating independently can lead to
                                     what an outside observer would view as a complex sequence of actions.


                              3.3.2  Concurrent behaviors

                                     An important point from the examples with the IRMs is that behaviors can,
                                     and often do, execute concurrently and independently. What appears to be a
                                     fixed sequence may be the result of a normal series of events. However, some
                                     behaviors may violate or ignore the implicit sequence when the environment
                                     presents conflicting stimuli. In the case of the parent agent, fleeing a predator
                                     was mutually exclusive of the feeding, nursing, and sleeping behaviors.
                                       Interesting things can happen if two (or more) behaviors are released that
                                     usually are not executed at the same time. It appears that the strange inter-
                                     actions fall into the following categories:


                         EQUILIBRIUM    Equilibrium (the behaviors seem to balance each other out): Consider feeding
                                        versus fleeing in a squirrel when the food is just close enough to a person
                                        on a park bench. A squirrel will often appear to be visibly undecided as
                                        to whether to go for the food or to stay away.
   94   95   96   97   98   99   100   101   102   103   104