capabilities 3/3

01<capability xmlns="http://jadex.sourceforge.net/jadex"
02 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
03 xsi:schemaLocation="http://jadex.sourceforge.net/jadex
04 http://jadex.sourceforge.net/jadex-0.94.xsd"
05 package="jadex.examples.hunterprey.creature.actsense"
06 name="ActSense">
07
08<capabilities>
09<capability name="dfcap"file="jadex.planlib.DF"/>
10</capabilities>
11
12<beliefs>
13<beliefset name="hunters"class="Hunter"exported="true"/>
14<beliefset name="preys"class="Preys"exported="true"/>
15<beliefset name="obstacles"class="Obstacle"exported="true"/>
16<beliefset name="food"class="Food"exported="true"/>
17<belief name="environmentagent"class="jadex.adapter.fipa.AgentIdentifier"/>
18<beliefref name="my_self"class="Creature"exported="true">
19<abstract/>
20</beliefref>
21</beliefs>
22
23<goals>
24<achievegoal name="move"exported="true">
25<parameter name="direction"class="String"/>
26</achievegoal>
27<achievegoal name="eat"exported="true">
28<parameter name="object"class="WorldObject"/>
29</achievegoal>
30<achievegoalref name="df_search">
31<concrete ref="dfcap.df_search"/>
32</achievegoalref>
33</goals>
34
35<plans>
36<plan name="move">
37<body>new MovePlan()</body>
38<trigger><goal ref="move"/></trigger>
39</plan>
40<plan name="eat">
41<body>new EatPlan()</body>
42<trigger><goal ref="eat"/></trigger>
43</plan>
44<plan name="updatevision">
45<body>new UpdateVisionPlan()</body>
46<trigger><messageevent ref="inform_vision"/></trigger>
47</plan>
48</plans>
49
50<events>
51<messageevent name="inform_vision"type="fipa"direction="receive">
52<parameter name="performative"class="String"direction="fixed">
53<value>jadex.adapter.fipa.SFipa.INFORM</value>
54</parameter>
55<parameter name="language"class="String"direction="fixed">
56<value>jadex.adapter.fipa.SFipa.JAVA_XML</value>
57</parameter>
58<parameter name="ontology"class="String"direction="fixed">
59<value>HunterPreyOntology.ONTOLOGY_NAME</value>
60</parameter>
61<parameter name="content-class"class="Class"direction="fixed">
62<value>CurrentVision.class</value>
63</parameter>
64<parameter name="content"class="CurrentVision"/>
65</messageevent>
66</events>
67</capability>
Fig.5.Act/sense capabilityof food the creature discovers.They will lead to plan executions for reaching the
food’s location and eating it.The third goal type is called“wander around”(line
36)and initiates random walking on the map.In this paper the details of goal
declarations are out of scope,for an extensive description the reader can refer
to[2].
For proper operation the basic behavior capability needs access to the en-
vironmental beliefs made available by the included act/sense capability(lines
8-10).Therefore concrete belief set references are defined for hunters,obstacles
and food(lines 13-16).These belief set references are also exported allowing an
outer capability or the creature itself to access these values.An abstract and ex-
ported belief reference is assigned for“my self”,as the basic behavior capability
still does not know in which exact kind of prey it will be used.
To illustrate the parametrization of capabilities it is assumed that two dif-
ferent kinds of preys need to be created from the basic behavior capability.The
first labeled“LazyPrey”should only flee from nearby hunters and otherwise just
sit and wait where it is.On the contrary a“CleverPrey”should wander around
to explore the map,eat food and flee from hunters.For each kind of prey a
separate initial mental state has been specified(lines 48-57 and lines 58-63).
For the operation of a LazyPrey it is necessary to have an instance of a“keep
alone”goal to flee from hunters.This is achieved by creating an initial goal of
that type(line 55).Additionally,it is required to turn o?the reactive creation of
“eat food”goals which cannot be done directly.Hence,a belief“eating allowed”
is introduced as some kind of goal creation switch and used in the creation
condition of the“eat food”goal.In the initial state this belief is negated which
ensures that no“eat food”goals will be instantiated at runtime.
A CleverPrey needs to exploit the whole functionality of the basic behavior
capability.Thus,initial goals for exploring the map(line 60)and for escaping
from nearby hunters(line 61)are created.Nothing has to be declared in the
initial state for“eat food”goals,because these are created automatically at
runtime whenever a new piece of food is discovered as mentioned earlier.
6 Summary and Outlook
This paper revisits the capability concept introduced by Busetta et al.for modu-
larizing BDI agents,in which several conceptual limitations have been identified:
–No generic mechanism for importing/exporting arbitrary mental elements
such as beliefs and goals is available leading to a decreased usability.
–The parametrization of capabilities is not supported which hinders flexible
reuse of capabilities.
–Only design time composition is supported.
–Refinements of mental elements are not addressed.
In turn a new capability concept based on the main ideas of the original proposal
is introduced to address most of these shortcomings.Regarding the usability and
generality a new import/export mechanism is presented,allowing to treat all01<capability xmlns="http://jadex.sourceforge.net/jadex"
02 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
03 xsi:schemaLocation="http://jadex.sourceforge.net/jadex
04 http://jadex.sourceforge.net/jadex-0.94.xsd"
05 package="jadex.examples.hunterprey.creature.preys.basicbehaviour"
06 name="BasicBehaviour">
07
08<capabilities>
09<capability name="actsensecap"class="ActSense"/>
10</capabilities>
11
12<beliefs>
13<beliefsetref name="hunters"class="Hunter"exported="true">
14<concrete ref="actsensecap.hunters"/>
15<beliefsetref>
16<!–similar declarations for obstacles and food omitted for brevity.–>
17<beliefref name="my_self"class="Creature"exported="true">
18<assignto ref="actsensecap.my_self"/>
19<abstract/>
20</beliefref>
21<belief name="eating_allowed"class="boolean">
22<fact>true</fact>
23</belief>
24</beliefs>
25
26<goals>
27<maintaingoal name="keep_alone"exclude="never">
28<!–details omitted for brevity.–>
29</maintaingoal>
30<achievegoal name="eat_food">
31<creationcondition>
32$beliefbase.eating_allowed&&$beliefbase.food.length>0
33</creationcondition>
34<!–further details omitted for brevity.–>
35</achievegoal>
36<performgoal name="wander_around"retry="true"exclude="never"/>
37<achievegoalref name="move">
38<concrete ref="actsensecap.move"/>
39</achievegoalref>
40<achievegoalref name="eat">
41<concrete ref="actsensecap.eat"/>
42</achievegoalref>
43</goals>
44
45<plans><!–omitted for brevity.–></plans>
46
47<initialstates>
48<initialstate name="flee">
49<beliefs>
50<initialbelief ref="eating_allowed">
51<fact>false</fact>
52</initialbelief>
53</beliefs>
54<goals>
55<initialgoal name="escapegoal"ref="keep_alone"/>
56</goals>
57</initialstate>
58<initialstate name="wander_flee_eat">
59<goals>
60<initialgoal name="wandergoal"ref="wander_around"/>
61<initialgoal name="escapegoal"ref="keep_alone"/>
62</goals>
63</initialstate>
64</initialstates>
65</capability>
Fig.6.Basic prey behavior capabilityelements(e.g.beliefs or goals)in a similar fashion and hence simplifying the
way in which a capability interface is defined.Furthermore,parametrization is
supported through the definition of an initial mental state,which is defined as a
part of the capability itself.This allows for easy capability configuration as only
the state names need to be known in the including capability.
In addition to the aforementioned issues the new capability concept is also
prepared to handle the dynamic composition of capabilities at runtime to flexibly
adopt agent behavior.The extension points to add functionality at runtime are
already present in the new capability concept and have been tested in the current
implementation.The process of removing capabilities and their elements at any
time during the agent execution has only been sketched and is left for future
work.
Another area of future work which is also facilitated through the locality prin-
ciple is the refinement of elements from subcapabilities.Properties of an element
might be redefined on a proxy element.In our vision such an element refinement
has similarities with the inheritance relationship from object-orientation.E.g.a
goal reference type could be used to inherit all the properties of the concrete goal
and add new properties such as additional parameters.At runtime the proposed
creation semantics could help in deciding in which cases the redefined or the
original specification should be used.
Finally,an interesting topic for future research regards bringing together the
role-based decomposition approaches with the component-based capability ap-
proach.A capability might provide an implementation entity for a role identified
in an abstract design.Building agents capable of playing certain roles could then
be easily done by composing the agent from capabilities for each role.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值