Advantages of programming by behavior
Constructing a robotic system under the Reactive Paradigm is often referredto as programming by behavior, since the fundamental component of any
implementation is a behavior. Programming by behavior has a number of
advantages, most of them consistent with good software engineering principles.
Behaviors are inherently modular and easy to test in isolation from the
system (i.e., they support unit testing). Behaviors also support incremental
expansion of the capabilities of a robot. A robot becomes more intelligent by
having more behaviors. The behavioral decomposition results in an implementation
that works in real-time and is usually computationally inexpensive.
Although we’ll see that sometimes duplicating specialized detectors
(like optic flow) is slow. If the behaviors are implemented poorly, then a reactive
implementation can be slow. But generally, the reaction speeds of a
reactive robot are equivalent to stimulus-response times in animals.
Behaviors support good software engineering principles through decomposition,
modularity and incremental testing. If programmed with as high
a degree of independence LOW COUPLING (also called low coupling) as possible, and high co-
HIGH COHESION hesion, the designer can build up libraries of easy to understand, maintain,
and reuse modules that minimize side effects. Low coupling means that the
modules can function independently of each other with minimal connections
or interfaces, promoting easy reuse. Cohesion means that the data and operations
contained by a module relate only to the purpose of that module.
Higher cohesion is associated with modules that do one thing well, like the
SQRT function in C. The examples in Sec. 4.3 and 4.4 attempt to illustrate the
choices a designer has in engineering the behavioral software of a robot.
No comments:
Post a Comment