Print this article

Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
93
INTEGRATION OF BDI PARADIGM INTO ABASIM
ARCHITECTURE
Michal VARGA, Norbert ADAMKO
University of Žilina, Faculty of Management Science and Informatics,
Slovak Republic
e-mail: [email protected], [email protected]
Abstract
The paper focuses on the integration of the BDI reasoning model into the
ABAsim architecture. The ABAsim architecture provides means for creation of
flexible simulation models of a broad range of complex service systems.
However, deliberative agents provided by the architecture may not be sufficient
enough when modelling systems containing entities with high-level decision
making capabilities, e.g. pedestrians. We propose an extension of the
architecture with the BDI paradigm that is utilized to model the reasoning of
dynamic agents. In order to integrate the BDI reasoning model into the ABAsim
architecture, we designed and implemented a special ABA-graph of agent’s
reasoner and provided a set of components to easily define agent’s behavior in
terms of BDI. Several changes to the communication mechanism were required
as well. The result of our work is a new approach to the modeling of intelligent
dynamic agents within the ABAsim architecture. This new concept is
demonstrated on an example of a pedestrian behavior model that is already
utilized in our pedestrian simulation tool.
Keywords: ABAsim, Belief-Desire-Intention, Modelling, Simulation
1
INTRODUCTION
The agent based simulation has gained significant popularity recently. It enables
efficient modelling of various complex systems, including pedestrian movement and
behavior. Pedestrians are independent, autonomous entities capable of intelligent
decision making; the advantages of their representation with agents are obvious.
However, the modelling of intelligent decision making process brings some challenges.
In our work, we utilize the ABAsim architecture developed at the Faculty of
Management Science and Informatics. The architecture supports flexible modeling of
complex service systems and has already been used in several commercially successful
simulation tools (e.g. Villon [1]). The simulation model based on the ABAsim
94
Integration of BDI Paradigm Into Abasim Architecture
architecture is composed of two layers of deliberative agents. This design enables the
creation of simulation models that reflect not only the functions of modeled service
systems, but also their internal management structure. However, the support for
modeling of high level reasoning processes is fairly limited in the architecture at the
present. In this paper, we propose an integration of high level reasoning framework
(based on the BDI paradigm) into the ABAsim architecture that will extend its
modelling abilities.
1.1
BDI
The Belief-Desire-Intention paradigm (BDI) is one out of many existing
frameworks for intelligent systems modelling [2]. The BDI [3], [4] models the
reasoning process in terms of beliefs, desires and intentions. It has been created to
model human practical reasoning [5], so it can be utilized to model pedestrian decision
making with great advantage. This paradigm is based on the procedural reasoning
system (PRS) [6]. Utilizing PRS one can create intelligent systems that are capable to
handle complex tasks in a dynamic environment. PRS represents an interface that
enables to simply integrate behavior that is aimed both on tasks and events in the
system. It is based on the procedural knowledge representation, which describes how to
execute a set of actions in order to achieve the target goal.
The BDI paradigm consists of three basic parts:
1. Beliefs represent agent’s knowledge of the world; they can be obtained by
scanning the environment. However, beliefs do not always have to be correct,
e.g. a student may believe that the class which is scheduled every Thursday
will take place also the next Thursday; however if the next Thursday is a
holiday, it will not.
2. Desires represent goals or expected final states. An agent may have more
desires, which may even be contradictory. For example, a person can desire to
travel home with a train at 9pm but also to go to the cinema at the same time.
3. Intentions unite the goal represented as a desire with the plan of its execution.
Unlike desires, intentions cannot be in conflict with each other. A person
traveling on train at 9pm does not watch a movie in a cinema at the same time.
Another important part of BDI is the plan library. This organizes plans that are
associated with desires. A plan contains a sequence of steps the agent has to perform in
order to achieve a goal. When the agent wishes to fulfill some desire D, he looks into
the plan library and chooses one plan from plans associated with D. Every plan
contains a trigger condition (determines the conditions in system, when the plan can be
chosen to fulfill desire) and an abort condition (conditions in system that immediately
stop plan execution).
The algorithm of a BDI interpreter presented in [3] is as follows:
initialize-state();
repeat
options := option-generator(event-queue);
(1)
Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
95
selected-options := deliberate(options);
update-intentions(selected-options);
execute();
get-new-external-events();
drop-successful-attitudes();
drop-impossible-attitudes();
end repeat
This algorithm can be interpreted in following way. In a loop, a generator creates
options (desires) based on the events in the system. Then a subset of options is
selected. These options are then inserted as intentions into the desire structure while
one must follow the intention consistency constraint (intentions must not be
conflicting). Subsequently an intention is selected from the intention structure and an
action from associated plan is executed. New events that occurred during the plan
execution are then inserted into the event queue. The last step is the actualization of
desire and intention structures. The agent removes accomplished desires (together with
respective intentions) and also drops those desires which he beliefs cannot be reached.
1.2 ABAsim
It has been already mentioned that agent based architectures provide efficient
means to model pedestrians’ movement and behavior. These models can be relatively
simple in case that pedestrians just walk to predefined places (simple evacuation
model); service oriented, if they contain places where some utility is provided (e.g. a
transportation terminal containing ATMs, cashiers, etc.); or even fairly complex,
containing for example information sources that dynamically affect pedestrians’
behavior (e.g. information boards at railway platforms, acoustic alarms causing
buildings evacuation). Besides the obvious agents representing pedestrians, more
complex models must also contain representations of other entities, structures and
events that influence the system operation. In order to efficiently manage the task of
modeling such systems, simulation architecture with respective properties has to be
chosen.
For our work, we have chosen the ABAsim architecture [7], [8], [9] that provides
support for modeling of complex service systems. The model is in ABAsim
architecture composed of two kinds of agents:
1. Managing agents that form a hierarchic structure and cooperate to reach a
system goal. Managing agents might not have a physical representation within
modeled system. They control unintelligent entities (e.g. moving stairs,
information sources), events (arrival of a new train) of the system and every
managing agent can manage a group of dynamic agents.
2. Dynamic agents model autonomous intelligent entities of the system. A
dynamic agent is always subordinated to one managing agent, who may give
him orders. A dynamic agent is obliged to fulfill goals set by its superior agent,
96
Integration of BDI Paradigm Into Abasim Architecture
but may also follow his own goals as long as these are not in conflict with
given goals.
To enable the mutual cooperation of components, simulation architecture has to
provide a communication mechanism. ABAsim utilizes message sending.
Communication competencies of components depend on the sender and receiver of the
message. In general, managing agent can use all communication means the architecture
provides: request some function, notify about an event, demand or entrust dynamic
agent to another managing agent, and of course affect goals of its subordinated
dynamic agents. The communication competencies of dynamic agents are limited.
They can communicate with other dynamic agents, but the communication with
managing agents is restricted to the exclusive communication with their respective
superior agent. A dynamic agent may not command its superior agent nor may it cancel
a goal assigned from the managing layer. However, a dynamic agent might ask for a
transfer to the supervision of another agent.
Every agent consists of manager and a group of assistants. The manager is an
element responsible for communication with other agents and deliberates about agent’s
activity. He cooperates with a group of assistants (owned by the agent), who perform
various tasks. Assistants can be divided using two criteria:
1. Execution time length: ABAsim comes with two types of assistants – prompt
and continuous. The difference lies in the way how they work in time. Prompt
assistant execution is invoked immediately and has no time duration (e.g. make
step towards target). Continual assistants may process their execution in some
time. They are also allowed to communicate with their manager (e.g. to notify
him about the occurrence of some event).
2. Assistant’s domain: Three categories can be identified: assistants responsible
for activity execution, environment monitoring and decision support.
Next table summarizes agent’s assistants, their purpose and execution time
duration.
Table 1 Assistants in ABAsim
Assistant
Prompt
Continuous
Action execution
Action
Process
System monitoring
Query
Monitor
Advisor
Scheduler
Decision support
Even though the ABAsim architecture provides support for deliberative agents, it
might not be sufficient and flexible enough to handle more complex requirements. The
extension of the architecture with the support for BDI based reasoning, bringing the
possibility to model agent’s behavior in terms of beliefs, desires and intentions will
enable the architecture to support modeling of more complex systems with agents
employing high level reasoning.
Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
97
2
INTEGRATION OF BDI PARADIGM
In the ABAsim simulation model, managing agents are organized in a static
hierarchical structure and follow defined system goal. Goals and organization of
dynamic agents are more flexible. Goals are assigned by managing agents; however
dynamic agent is also free to identify and fulfill own goals. Hence it seems plausible
to provide BDI reasoning ability only for dynamic agents. If required, dynamic agents
can mimic the behavior of static managing agents and build hierarchical structure as
well.
2.1 Communication analysis
The strict hierarchical organization and communication rules in ABAsim
architecture, namely the fact that dynamic agent can communicate only with superior
managing agent (and of course other dynamic agents), may cause several problems that
need further analysis.
Consider the situation in which a BDI agent initializes the transfer to other
managing agent. If the dynamic agent is to be considered intelligent, it must be able to
detect the situation when he leaves the domain of its managing agent and also be able
to identify the new (target) managing agent. The dynamic agent can utilize Transfer
message (sent to its managing agent) to signalize its will to change the superior agent.
Even though the superior agent is in general not obliged to comply with a request of
the dynamic agent, in our extension we will consider the Transfer request to be always
satisfied. After the execution of the transfer, dynamic agent can be notified about this
fact using a Notify message.
The ABAsim architecture provides two messages to handle agent’s goals. The
managing agent uses the Goal message to assign a specific goal to the dynamic agent.
After the dynamic agent reaches the goal, it has to respond with a Done message back
to its superior agent. It is necessary to ensure correct delivery of the notification about
the accomplishment of a goal even after the dynamic agent has changed its superior
agent. The problem again originates in the restriction of communication to the superior
agent only. The solution of this problem is quite straightforward; all that is needed is to
ensure that Done message will be automatically addressed back to the original sender
of the Goal.
In order to provide efficient means for modelling, it seems reasonable to enable
dynamic agent to Request some functionality from any managing agent in the model
(not only from its superior agent). A good example is a pedestrian standing in front of
the elevator, requesting a managing agent to move the cabin to its level.
Proposed changes in communication mechanism between managing and dynamic
agent are depicted in figure 1.
98
Integration of BDI Paradigm Into Abasim Architecture
Figure 1 Communication between managing (A-E) and dynamic (α) agents: Transfer
(a); Goal/Done (b) and Request/Response (c).
2.2 Design of the BDI dynamic agent
In the ABAsim architecture, model designer usually defines the functionality of
agent’s manager utilizing special subclass of Petri nets, called ABA-graph [9]. In order
to integrate the BDI paradigm into the agent’s reasoning, we have utilized the ABAgraph. This however limits the ability of the model designer to define its own graph. If
the designer chooses to implement a BDI dynamic agent, its behavior will no longer be
defined using ABA-graph, instead the designer will use the BDI paradigm components,
namely beliefs, desires, intentions and plans. Figure 2 depicts the decomposition of a
BDI dynamic agent in ABAsim architecture.
Sen sor
Beliefs
Desires
Reasoner
Plan
library
Intentions
Acti on
Figure 2 BDI agent decomposition
The implemented BDI library of the ABAsim architecture provides all elements
necessary for proper design of a BDI based agent – the agent itself, predefined reasoner
Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
99
(manager), a set of specialized assistants (designer can re/define their behavior),
specialized message for communication of BDI components, basic element types
representing beliefs, desires, intentions and plans and also stores for these components.
The basic principles of definition of a BDI dynamic agent will be described using
the simple example of a pedestrian. In a very basic model, two steps must be done.
First, possible desires of the agent have to be identified, e.g. “Go to platform”, “Buy
tickets”, etc. Second step is to design plans and assign them to defined desires (agent
represents this as “To achieve this desire, I can use these plans.”).
Each plan contains three conditions:
1. Trigger is launched when conditions in the model permit the plan to be used
(to fulfill respective desire). If, for example, agent desires to “go to floor 5”
and the elevator is broken, the agent cannot use it to get there (cannot utilize
the plan “Use elevator”), instead it has to use stairs (utilize plan “Use stairs”).
When agent finds plan suitable for a specific desire, he pairs them into an
intention.
2. Abort signalizes situation when it is no longer possible to follow current plan
to fulfill a goal. If agent decides he will “Use stairs” to fulfill the desire “Go to
floor 5”, but it finds locked door on the way, it has to stop and reconsider the
plan.
3. Finish represents successful accomplishment of the plan. The associated desire
is declared as done.
It is obvious that agent’s execution is written in plans. Plan can be defined in a
form of a diagram. Each plan consists of one starting and two end points. First
endpoint represents successful execution and second plan failure. Agent’s actions can
be divided into three categories. These are execution of some task, waiting until
specific event occurs and communication with other agents (since the communication
competencies of the BDI dynamic agent are expanded, it may communicate with all
managing agents in the hierarchical structure). It is also possible to branch plan using
conditions. The BDI agent may resolve the conditions according to its beliefs and/or
current situation in the model. Last component of the plan is desire. This may cause
another plan to be embedded into current plan or simply add new desire into desire
store and continue in the plan execution.
Figure 3 depicts a plan that a pedestrian may utilize to use the elevator to go to the
desired floor. First, he must identify whether the cabin is present or not. If it is not, the
pedestrian requests managing agent responsible for elevators to move the cabin to its
level. Afterwards, the pedestrian has to wait until the cabin arrives. One has to keep in
mind, that despite of using BDI, the pedestrian is still a dynamic agent, so before
entering the cabin, it must ask for the permission to do so. If the permission is not
granted, the agent has to wait and call the cabin back. Otherwise it waits until the door
is opened and goes inside. To do so, the agent creates desire to go to specified place
within the cabin and utilizes another plan to fulfill it. After the agent reaches the place
100
Integration of BDI Paradigm Into Abasim Architecture
in the cabin, it notifies the managing agent about its destination floor selection. Then
the agent simply stays in the cabin until the cabin reaches the chosen level.
Figure 3 The graphical representation of the plan Use elevator
The agent’s choice of plans is affected by beliefs. Beliefs are collected from the
agent’s environment and stored in belief store. The reasoner of a BDI agent is
responsible for collection of beliefs, handling of intentions as well as execution of
plans.
2.3 BDI reasoner
Original form of the ABA-graph of the BDI reasoner has already been published
in our previous work [10]. The basic design remains the same; however several new
requirements (integration of parallelization, extended communication, etc.) led to
several changes. The simplified version of final ABA-graph design is depicted in
figure 4.
Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
101
Code
Agent
Goal
Create and save
desire
Agent
Cancel
Remove intention
and abort desire
Agent
Work
Initialization
1
Absorption
ST
Agent
Stop
Finalization
Kernel
Tick
Collect beliefs
Create intentions
Drop impossible
intentions
Can drop?
Goal
agent
Nothing to drop
Kernel
Synchro
Kernel
Notify
DT
Process plan
Result
Get plan
item
Action
Desire
Message
DT
Send a message
Agent
Send
Create and save
desire
Execute an action
Finish desire
Done
Goal
agent
Nothing to finish
Absorption
Figure 4 Simplified ABA-graph of BDI reasoner
One of major tasks of the reasoner in ABAsim architecture is to define the
reaction to received messages. Messages processed by the BDI reasoner can be divided
into two categories:
1. Messages sent by managing agents that are processed simply as commands.
2. Messages sent from the simulation kernel that cause the agent to execute
actions, communicate with managing agents or change its internal structure.
2.4 Processing messages sent by managing agent
The BDI agent has to follow goals assigned by managing agent using the Goal
message. Within BDI we can understand assigned goal as a desire to fulfill managing
agent’s command. Therefore dynamic agent reacts to the Goal message by creating and
saving a desire.
102
Integration of BDI Paradigm Into Abasim Architecture
Managing agent can issue a Cancel message, forcing dynamic agent to
immediately stop following cancelled goal. This is achieved by removing intentions
from intention structure and dropping all embedded desires (if existing).
Managing agent can control autonomous functions of a dynamic agent using
Work/Stop messages. The Work message causes BDI agent to subscribe to the Tick
message sent by simulation kernel in regular time intervals, allowing the BDI agent to
autonomously execute its plans. The Stop message leads to exactly opposite reaction
(the agent unsubscribes from the delivery of Tick messages, thus stopping its
autonomous execution). These messages have no other effect on agent’s reasoning. If
the dynamic agent is stopped, it can be set to work again without any negative impact
on its internal consistency.
2.5 Processing messages sent by simulation kernel
The most important message that dynamic agent receives is the Tick message.
This message wakes the agent up and the agent then starts reasoning about new and
current goals, plans and executed actions. The agent’s reaction to this message is
designed as presented in algorithm 1. First, agent has to collect new beliefs. For this
purpose it utilizes a group of specialized Queries that provide information from the
system. The BDI agent then transforms the information into beliefs and stores them
into the belief store. According to new beliefs, the agent then considers creating new
intentions from current desires. Subsequently tries to find a suitable (trigger conditions
has to be fulfilled) plan from the plan library. If such a plan exists and new desire is not
in conflict with currently running intentions, a new intention is generated and inserted
into the intention store. Next, all impossible attitudes are dropped. These are intentions,
for which the abort condition has been satisfied. When dropping a desire, the dynamic
agent has to distinguish between his own goals and goals assigned by its managing
agent. Prior to dropping managing agent’s goal, the agent has to ask for the permission
to do so.
After these steps are performed, the dynamic agent is in a state, at which no
intention can be created or removed. The agent can start picking intentions for
execution, considering only intentions that are not suspended (waiting for some event
to occur). Available intentions are evaluated in order according to their priority. As
mentioned before, plans determine agent’s actions. The most important assistant to
process plans is an adviser called “Get plan item”. This assistant reads the plan
diagram, evaluates decisions and waits, identifies whether plan is completely done or
has been aborted and most importantly identifies the action to execute. There are three
different types of actions:
1. Execution of an action. The dynamic agent performs a simple action
according to the parameters of the plan.
2. Send a message. The dynamic agent prepares the message and sends it as
simple Notice, Request or Transfer. Sending mechanism is specified by the
plan.
Journal of Information, Control and Management Systems, Vol. 12, (2014), No. 1
103
3.
Create a desire. The dynamic agent may create its own desire. This desire
may be embedded into current one (in this case, current intention will be
suspended until new desire is finished or aborted) or simply inserted into the
desire store. The desire will be executed after trigger conditions of one of
associated plans are satisfied.
When the execution of the plan is finished, the agent inspects whether the plan
has been completed (finish condition is satisfied). If so, the agent notifies the managing
agent, which set the goal (if it was not a goal created by the dynamic agent itself),
removes the intention and marks the desire as accomplished. If the execution of the
plan is not finished, the agent continues to execute a plan of another intention. After all
intentions have been processed, agent ends its work in current Tick.
Intention may become suspended in two more situations. (1) When the agent
utilizes external source to execute an action, e.g. when using parallelization, the agent
passes the control to the parallel synchronization mechanism and suspends own
execution until the parallel computation is done. To be able to continue where the
execution of the agent stopped, kernel sends the agent a Synchro message. (2) When
using Notice-Notify sending mechanism. In this case, the agent waits for the delivery of
the Notify message. Afterwards the agent continues with the evaluation of the plan.
3
CONCLUSION
This paper presented the integration of the BDI paradigm into the ABAsim
architecture. Dynamic agents have been extended with the support for BDI reasoning
and their competences have been expanded. Dynamic agents are now allowed to
communicate with agents other than their superior managing agent and can request
services from managing agents.
The complete BDI reasoning engine has been implemented into the reasoner of a
dynamic agent. Model designer has to define only few basic components and can
utilize the powers of the BDI paradigm.
First of all, possible agent’s desires have to be identified. Next step is to prepare
agent’s plan library that specifies set of plans used to fulfil particular desires. The plans
are defined as a diagram, containing one starting point and two ending points
(representing success and failure). They are composed of actions, decisions,
communications and waiting. Plans execution is controlled by trigger; finish and abort
conditions defined by model designer. Processing of respective plan components is
handled by agent’s assistants. Basic behavior of most assistants is predefined by
architecture, however model designer is able (and sometimes obliged) to re-define it.
To make models more complex, model designer may define information and
information sources. Agents utilizing BDI are able to detect and process this
information in order to alter current and future desires.
The BDI extension of the ABAsim architecture has been successfully
implemented and tested within PedSim simulation tool [11]. The utilization of BDI
104
Integration of BDI Paradigm Into Abasim Architecture
allowed the modeled pedestrians to make decisions according to the actual conditions
in the model. This enabled the modeling of situations such as incomplete knowledge of
infrastructure (foreigners may not know about hidden corridors), ad-hoc route
changing (pedestrian evaluates that there are too many people in the way, and therefore
chooses different route) or random time of critical event appearance (fire alarms do not
start at the same time).
REFERENCES
[1] N. Adamko, V. Klima and A. Kavička, "Villon - Agent based generic simulation
model of transportation logistic terminals," in European Simulation and
Modelling Conference 2007. St. Julian's, Malta: EUROSIS-ETI, 2007.
[2] N. Hawes, "A survey of motivation frameworks for intelligent systems," Artificial
Intelligence, vol. Vol. 175, pp. 1020-1036, April 2011.
[3] A. S. Rao and M. P. Georgeff, "BDI Agents: From Theory to Practice," in
Proceedings of the First International Conference on Multiagent Systems, 1995.
[4] A. S. Rao and M. P. Georgeff, "Modeling Rational Agents Within BDIArchitecture," in Proceedings of the Second International Conference on
Principles of Knowledge Representation and Reasoning, San Mateo, CA, 1991.
[5] M. E. Bratman, Intentions, plans and practical reason, 1999.
[6] Artificial Intelligence Center, "Procedural Reasoning System User's Guide," 13
March 2001. [Online]. Available: http://www.ai.sri.com/~prs/prs-manual.pdf.
[Accessed 22 11 2013].
[7] N. Adamko, V. Klima, M. Lekýr and A. Kavička, "Flexible hierarchical
architecture of simulation models," in The 2004 European Simulation and
Modelling conference, 2004.
[8] N. Adamko and V. Klima, "Agent based simulation architeture augmented by
actors," in ESM'2006 - The 2006 European Simulation and Modeling Conference,
Tolouse, 2006.
[9] N. Adamko, Agentovo orientovaná simulácia zložitých obslužných systémov,
Žilina: Fakulta riadenia a informatiky, 2013.
[10] M. Varga, "Belief-Desire-Intention in the ABAsim architecture," in In: MiST
2013 Mathematics in Science and Technologies : proceedings of the MiST
conference 2013, Fačkovské sedlo, Kľak, Slovakia, 2013.
[11] M. Varga, "Application of the ABAsim architecture in the pedestrian movement
modeling tool," Journal of Information, Control and Management Systems, vol.
10, no. 1, pp. 71-79, 2012.