Vous êtes sur la page 1sur 5

Copyright IFAC Real Time Programming

Georgia, USA, 1991

MANAGING BELIEFS, DESIRES, AND


TIME IN REAL-TIME SYSTEMS
T. E. Bihari*, P. S. Gopinath** and T. M. Walliser*

*Adaptive Machine Technologies Inc., 1218 Kinnear Road, Columbus, Ohio, USA
** 1078 Trowbridge Court, Longwood, FL 32750, USA

Abstract. A high-level " agent oriented" model of intelligent real-time systems


is discussed. The model is based on epistemic logic. The initial application
domain is intelligent robotics . Preliminary results indicate that the model can
be mapped to low-level system models to facilitate the development and use of
more intelligent, automatic, process scheduling and resource allocation
algorithms.

Keywords. Computer control; computer software; high level languages;


information science; intelligent machines ; programming theory; robots;
software development; software engineering.

INTRODUCTION Lately, however, driven by advances in both HRTS


and IRTS technology, and by the increasing
Interest has been increasing in intelligent hard-real- complexity of potential applications, the two areas
time systems. This interest is driven by applications of interest are beginning to converge. We believe
such as the Pilot's Associate (Lark, 1990) and that there is a need for design methodologies that
others, that require high-level reasoning abilities are consistent with both areas and that can be used
within a hard-real-time environment. Tackling for designing well-integrated systems.
these applications requires combining hard-real-
time technology with intelligent-system technology. Existing systems, such as the Adaptive Suspension
Much of the existing research in hard-real-time Vehicle (Bihari, 1989b), which combine the need
systems (HRTS) has been directed at specifying, for high-level reasoning with the need for hard-real-
expressing, and fulfilling the timing requirements of time performance , are often organized in distinct
a system . Such efforts have been oriented towards layers, where the higher-level layers are responsible
the concrete design-implementation models (Mok, for functions, such as planning, that are typically
1984) of a system (e.g., processes and deadlines) . associated with the IRTS domain. These layers
Timing constraints for a system are usually typically have flexible timing constraints. However,
determined by the interactions of the system with as one moves down the layers of the system, the
the external environment. Existing hard-real-time functionality of the layers shifts towards HRTS
systems are designed to satisfy real-time constraints technology, with greater emphasis being placed on
in applications where timing errors can have serious meeting deadlines and other time-related
consequences. However, such systems are not specifications.
usually required to exhibit intelligent "reasoning"
behavior. A typical example of such a hard-real- In this paper we describe an object-oriented
time system is a control computer for a dynamically programming methodology, and examine its
unstable, fly-by-wire aircraft. appropriateness as a model for combining the
HRTS and IRTS technology. As a specific example ,
In contrast , much of the research in intelligent we discuss the notions of desires and beliefs taken
real-time systems (IRTS) has been directed at from IRTS, and the implications of their application
reasoning about time with respect to abstract to the HRTS problem of controlling a robot arm.
models of a system (e .g., tasks, environments, and We propose that complex applications, such as
intelligent agents (Shoham , 1990. Such reasoning these, are best represented as a hierarchy of
may include choosing timing constraints based on objects, where the desires and beliefs of objects are
the goals of the system . Existing prototype systems represented as object attributes.
exhibit intelligent behavior and some degree of
real-time behavior. However, such systems are not
usually driven by hard-real-time constraints. AGENTS, BELIEFS, AND DESIRES
Typical examples of intelligent real-time systems
include wheeled robots that are required to Shoham (1990) describes agent-oriented
negotiate a room containing obstacles, using programming as a computational framework in
ultrasonic or vision sensors . The robots are usually which agents - intelligent objects - relate to one
permitted to stop and "think" as necessary. another, and the environment, based on such

107
concepts as beliefs, desires, and goals. Agents derive from the overall capabilities of the
believe propositions about the world. Agents have agent (e.g., a robot firefighter), the
desires about the world. When an agent decides to characteristics of the environment (e.g., a fire
actively pursue a desire, it forms an appropriate site), and the requirements of the task (e.g.,
goal. In this paper, we will equate desires with putting out the fire).
goals for simplicity. We assume that if an agent
desires something, it immediately forms a The flexibility of these time constraints (hard
corresponding goal. In Shoham 's language, for deadlines vs soft deadlines), and the degree to
example, which they can be traded for various levels of
quality of the result, depend on the characteristics
< 9: 15, BHarold < 9:30, GC.l'io < 10:00, of the real world from which they are derived. For
weld( Calvin, Car14 ) > > > example, it is difficult to dynamically change the
natural frequency of a physical robot arm, so the
means that at 9:15, Harold believes that at 9:30, arm's servo controller must operate near a given
Calvin will have the goal of welding Car14 at 10:00. frequency. Fortunately, at the servo level, the arm ' s
When parsed in an LR fashion, such a statement world is fairly static and well understood. The servo
can be viewed as being a hierarchy of beliefs and computations usually take a fixed or tightly bounded
goals. However, at any point during the execution amount of time . In contrast, the task planner for a
of the application, there may exist a discrepancy firefighting robot is operating in a more dynamic
between the beliefs (goals) of one layer and the and less understood world. It is not possible to plan
goals (beliefs) of an immediately neighboring layer. optimally, using any fixed amount of computing
Such discrepancies result from race-conditions, resources, since there is always too much
timing-skews, or simply delays in propagating information, some of which is wrong, and some of
information through the hierarchy. Therefore, when which will become outdated by new information.
such high-level statements are translated into lower- Fortunately, the task planner may be able to
level constructs, they must be augmented with generate acceptable sub-optimal plans, as time and
timing constructs that capture the acceptable resou rces allow.
granularity of belief (goal) discrepancy.

Agents communicate by sending messages with well THE OBJECT-ORIENTED MODEL


defined semantics. Two important message classes
are Inform messages and Request messages. Our model for integrating HRTS concepts and
Inform messages transfer beliefs and goals between design with IRTS concepts and design is built
agents. Request messages allow agents to ask that around hierarchical interacting objects (Bihari,
other agents perform actions. 1989a; Gopinath, 1989). Objects typically
correspond to real-world entities (e.g .,
Shoham 's research objectives include the automatic manipulators, sensors, etc.), although this is not
translation of such high-level statements into strictly necessary. Figure 1 shows a system
language constructs that can directly control the containing two objects: a robot Arm which can move
associated machines. Our goals are somewhat to different positions and grasp pay loads, and a
similar. We believe that, as intelligent real-time Planner which generates task plans for the Arm to
systems become more complex, it will become perform .
necessary to continually trade the timeliness of an
action for the quality of its result. To do so in Objects have attributes which have values. These
actual operation, it will be necessary to encode the values typically represent some aspect of the
meanings of timeliness and quality in a form that associated entity (e.g., the velocity of a robot arm)
can be accessed by both human and automated represented by the object. Specifically, attributes
decision-makers (e.g., processor schedulers). can represent the beliefs and desires of the objects.
Attribute values are tu pIes with the form:

TIMELINESS < Generation Time, Valid Time, State >

In real-time applications, time constraints are The Valid Time is the time at which the State is
derived from the entities in the real world (e.g., supposed to correspond to the state of the
agents, environments and tasks) and the associated real-world entity . The Generation
relationships among them . In robotics, for example: Time is the time at which the tuple was created.
This creates a two-dimensional space of values for
Servo-control time constraints derive from the each attribute . The States themselves may be
structures and dynamics (e.g., natural complex entities, containing, for example, the
frequencies) of the objects being controlled expected value, tolerances, probabilities, and so on .
(e.g., the aluminum links of a robot
manipulator), and how they interact. Objects are typically composed of sub-objects.
Figure 2 shows the sub-objects of the Arm in Fig. 1.
Elemental-move motion-planning (i.e ., The attributes of such a composite object may be
planning how to move from point A to point synthesized from those of its sub-objects (e.g.,
B) time constraints derive from the position mass), or they may reflect features unique to the
and velocity required of the object and the composite object which are not found in the sub-
positions and velocities exhibited by other objects. For example, an Arm can "lift" a payload,
objects (obstacles). but a Gripper cannot.

High-level , task-planning time constraints

108
A rm-P osition to the Planner ' s Believed -Arm-
PLANNER Desired
ARM Position a nd transmission of an Inform message
De sired
A rm
Positio n
~
.. A rm
Positi on
containing t he value of the Pl anner's Desired-Arm-
Position to the Arm ' s Desired-Arm-Position.

Believe d
Arm
...
r-.
Be li eved
A rm AN EXAMPLE
Positi on Pos ition
In this sectio n, we de scribe an example application,
De sire d
Grippe r
Positi on
.. Desired
--"" G rippe r
Position
s pecify its required behavior, a na lyze the
information content and flow, a nd di sc uss de s ign
and implementation alternatives.
Beli eved
......
Beli eved
Grippe r Gripper
Pos iti on Pos iti on Task Specification

Conside r the syste m in Fig . I and 2. Suppose that


in this app lic atio n, th e Arm is required to ungrasp
Fig . 1. A rea l-time sys tem. (and drop) a payload , which it is al ready holding , at
a s pecific po s ition P( drop). at a specific t ime
T(drop). If the Arm is not in pos iti on P(drop) at
time T(drop) , th e payload shou ld not be dropped.
Ohjects interact hy passing va lue s among their The ta sk plan gen erated by the Planner consists of
a ttribute s. Cons ider the Planner-Arm system. At two s t ateme nt s:
a ny instant , the Pl anner ' s desires and beliefs
concerning the A rm may be separate from the The Planner desires that t he Arm be in
Arm's desires and beliefs . For example, the po s ition P(drop) at time T(drop).
Planner and Arm might have the following attr ibut e
values: IF t he Planner believe s that the Arm w ill be
in position P(drop) a t time T(drop) . THEN
illtiW Attribute Y.a.l.J.t.e. t he Planner desires that the Arm ungrasp the
Planner Be Iieved-Arm-Po s ition < 1:00,2:00,7 > payload at time T(drop) .
Planner Desi red-A rm-Po s i tion < 1:00.2 :00,8 >
Arm Believed-A rm-Posit ion < 1:00,2:00.9 >
Arm Desi red-A rm-Po sit ion < 1:00.2:00.- >
in forma ti on Analysis
ARM

JOINT CONl ROLLER Figu re 3 s hows a po ss ihle sequence of events for the
task. Based on its beliefs at time T(O). the Pl a nner
I----.t Joinl decide s to begin the two-step p lan . At T(l). the
Posilion
Planner inform s the Arm th at it de s ire s th e A r m to
be in pos iti on P(drop) at t im e T(drop). At T(2).
the Arm begin s the ac ti v itie s necessa ry to move the
Arm. Thi s may inc lud e iterati o ns of the Arm 's own
Choose-Execute-Eva lu ate cycle. made up of s m a ll-
GR IPPER grai n motion p lan ning , sens in g , and servo control.
The Arm actually fini s hes movin g to P(drop) at
T(move done). Thi s time may va ry. d epe ndin g on
th e previou s pos ition of the Arm.

The P lanner mu st know the likel y succe ss or failure


of the Arm's movement by T(4), if the Planner is to
request that the A rm open its gr ipper by T(drop).
Fig . 2. The Arm object and sub-ohjects. Therefore, the Arm mu st inform the Pl a nner of it s
expected position at T(drop) no later than T(3).

The critical con s id eration for the belief accu racy of


This says th at, at 1:00, the Planner believes that the this system is the relation s hip between T(3) and
Arm 's 2:00 position will be 7, b ut desires that it be T(move done). If T(3) is before T(move done) .
8 . At 1:00. the Arm believes that its 2:00 position t hen at T(3) the Arm cannot know for certain that
w ill be 9, and it has no desired position. its move w ill be s ucces sf ul. It mu s t se nd it s curre nt
belief to the Planner. Suppose the Arm inform s the
In a re al-time sys tem , objects frequent ly operate in Planner that it ant icipates a s ucce ssful move .
Choose-Execute-Evaluate cycles. Based on its Between T(3) a nd T(move done) , the A rm m ay
existing beliefs, a n objec t chooses a p la n of act ion . encoun ter an obstacle or other problem preventin g
It executes the action (by informing ot her objects of its move to P(drop) by T(drop) . The Arm no longer
its desires), then evaluates the results (by updating be lieves that it wi ll be a t P(drop) at T(drop), but
it s own beliefs). In the Pl an ner -A rm system, this the Pl anne r s till does, and acts acco rdin g ly.
cycle might include the tran s mission of an In form
me ssage containing the value of the Arm ' s Believed- A ss uming that the relationship between T(3) a nd

109
where T( 4) is the Generation Time, T( drop) is the
Valid Time, and P(drop) is the State .
PLANNER ARM

T(O)
The transfer of desires and beliefs between objects
via Inform messages consists of transferring
Decide 10 Move Arm
attribute values. For example, the statement :
T(J)
"At T( 1), the Planner informs the Arm that it
T(2) desires the Arm Position to be P(drop) at
T(drop) . The Arm receives the information
T(3)
at T(2) ."

T( move done) is represented as follows. The Planner ' s Desired-


T(4) Arm-Position attribute has the value :
Decide 10 Drop Payload
< T(l), T(drop), P(drop) >
T(5)
The < T(drop), P(drop) > sub-tuple is transferred
to the Arm's Desired-Arm-Position attribute,
T(6)
resulting in the value:

< T(2) , T(drop), P(drop) >


T(drop)

Notice that only the < Valid Time, Value > sub-
tuple is transferred . This amounts to the Arm
"internalizing" the desires of the Planner - it
Fig. 3. An interaction sequence. accepts the Planner ' s desires as a c ommand. That
is, the Arm records the statement:

T(move done) varies, it may be necessary to trade "At T(2), the Arm desires the Arm Position
the timeliness of the task (i.e., opening the gripper to be P(drop) at T(drop) ."
at exactly T(drop for the accuracy of the Planner's
beliefs about the Arm ' s position. Several options In general, it is possible to have arbitrarily complex
exist: attributes, such as the Arm attribute:

"the Arm's belief about the Planner ' s desire


The Planner may wait until it is confident that about the Arm ' s Position"
the Arm is at P(drop), but waiting may
prevent the Arm from dropping the payload However, we believe that, for most hard-real-time
until after T(drop). systems in the robotics domain , "internalizing"
beliefs can be used to simplify designs and maintain
The Planner may request that the Arm drop acceptable real-time performance .
the payload at exactly T(drop), without high
confidence that the Arm is at P(drop).
Design and Implementation Choices
The Planner may choose to abort the task,
and not drop the payload anywhere, unless Detailed design and implementation of the Planner-
there is a high degree of confidence that the Arm system requires many decisions that may affect
Arm is at P(drop) at T(drop). the timeliness and belief accuracy of the system.
Passing beliefs and desires between objects involves
The choice depends on the relative costs of sending and receiving Inform messages, and
dropping the payload on the wrong position , at the associated issues such as message initiation and
wrong time , or not dropping the payload. message transmission delays .

In the Planner-Arm system , which object(s) should


Information Design initiate the transfer of information? In our object
model, as in others, two types of information
Figures 1 and 2 show the major components and transfer are possible:
interactions of the application. The desires and
beliefs of the objects are encoded as attributes of Value = Get( Object, Attribute, ValidTime )
the objects . For example, the statement:
Put( Object, Attribute, ValidTime, Value)
" At T(4), the Planner believes that the Arm
Position at T(drop) will be P(drop). " The Put operation is simply an Inform message.
The Get operation is actually two messages : a
is described by giving the Planner an attribute Request message asking for the information and an
called Believed-Arm-Position, and giving the Inform message containing the information . Both
attribute the value: operations transfer information. They differ in the
control of the transfer. For example, if the Planner
< T(4), T(drop), P(drop > needs to know the Arm ' s believed position at

110
T(drop), there are two options: the functionality (and belief inconsistency
problems) of the Planner into the Arm. In fact, the
The Arm could send "Put(Planner, original Planner-Arm system can be thought of as
Believed-Arm-Position, T( drop ),Position)" to encapsulated in a larger "Smart-Arm" object.
the Planner each time the Arm's belief about
its position at T(drop) changes . The Arm
controls when the information is transferred. CONCLUSION

The Planner could periodically send Intelligent, distributed, real-time systems can never
"Get(A rm, Be lieved-Arm- Posi tion, T( drop " maintain perfect, consistent information about a
to the Arm . The Planner controls when the complex and changing environment, particularly
information is transferred. given the hard time constraints on their operation .
System specification and design languages which
The first option may make sense when the Arm ' s represent the meanings of timeliness and quality
helief changes significantly at well-defined points . and which can be mapped to hard-real-time
When asked to move to P(drop) by T(drop), for implementations are needed.
example, the Arm might first determine if P(drop)
is in its possible range of motion; then determine if We have proposed a particular object-oriented
the move from its current position to P(drop) is system model that can represent high-level concepts
possible by T(drop) ; then execute the move. The such as beli efs and desires and have discussed the
Arm's belief may become more certain after each translation of these concepts to practical designs
step, and pass the updated information to the and implementations .
Planner.
Dynamically trading belief and desire consistency
The second option may make sense when the Arm for timeliness may allow tasks which cannot be
itself cannot judge the significance of its beliefs . performed on-time and with complete confidence in
This is true, for example, when the Planner is the results to be carried out slightly late or with less
gathering general information about the Arm's state confidence. Practical approaches to this problem
before it puts any plan into action. are needed .

As a rule , the mechanism for transferring beliefs


and desires between objects is driven at least in part REFERENCES
by the constraints on each object's ability to use the
new information . If the Arm cannot abort a move Bihari, T .E ., P.S. Gopinath, and K. Schwan (1989a).
in mid-motion , it makes little sense for the Planner Object-oriented design of real-time systems.
to pass its new desires to the Arm. It may make Proceedings of the 10th Real-Time Systems
more sense for the Arm to ask for the Planner' s new Symposium IEEE. pp. 194-201.
desires only when the Arm has reached a state
where it can process new information. Bihari, T .E., T .M. Walliser, and M.R . Patterson
(1989b). Controlling the Adaptive
When transferring beliefs and desires, which object Suspension Vehicle . IEEE Computer Vol.
should keep track of message transmission delays? 22, No. 6, pp . 59-65.
If we assume fixed or bounded transmission delays
and that a global time base is available , each Lark, J.S., L. Erman, S. Forrest, K. Gostelow, F.
message can include the time at which the message Hayes-Roth, and D . Smith (1990) . Concepts,
was sent, and the receiver knows when the message methods, and languages for building timely,
was received. Therefore , it may make sense for the intelligent systems. Real-Time Systems
receiver of a message to record the transmission Kluwer, Hingham , MA . Vol. 1 No. 5, pp. 127-
times of messages it receives . Then, if an object is 148.
expecting a response by a certain time, it can
include the expected transmission delay for the Gopinath, P.S., T .E . Bihari, K . Schwan, and A.
response message in the deadline. For example, the Gheith (1989). Operating system constructs
Planner can tell the Arm that a response must be for managing real-time software complexity.
sent by T(3), because the Planner wants to receive Proceedings of the Workshop on Operatinll
it by T(4) . Systems for Mission Critical Computinll
Office of Naval Research. pp. U1-U9.
A general note: It might seem that one way to get
around the problem of inconsistent beliefs in the Mok, A .K. (1984). The design of real-time
Planner-Arm example is that the Planner tell the programming systems based on process
Arm the precondition for opening the gripper. That models . Proceedinlls of the 5th Real-Time
is, the Planner can tell the Arm " Open the gripper Systems Symposium IEEE. pp . 5-17.
at T(drop) only if the position is P(drop) at
T(drop) ". This is just moving the problem, Shoham, Y. (1990). Agent oriented programming.
however. As Fig. 2 shows, the Arm object is really Technical Report STAN-CS-90-1335 Stanford
just a shell containing several sub-objects. The University. pp. 127-148.
Gripper-Controller could be requested to ask the
Joint-Controller for the position before dropping
the payload, or a new "Sub-Planner" object could
be added to coordinate the Gripper-Controller and
the Joint-Controller. That would just move some of

III

Vous aimerez peut-être aussi