ITeye博客

capabilities 3/3

turingfellow · 2010-08-11 22:58 · jade · 编程语言 · Markdown

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 09<capability name="dfcap"file="jadex.planlib.DF"/> 10 11 12 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 20 21 22 23 24<achievegoal name="move"exported="true"> 25<parameter name="direction"class="String"/> 26 27<achievegoal name="eat"exported="true"> 28<parameter name="object"class="WorldObject"/> 29 30 31 32 33 34 35 36 37new MovePlan() 38 39 40 41new EatPlan() 42 43 44 45new UpdateVisionPlan() 46 47 48 49 50 51<messageevent name="inform_vision"type="fipa"direction="receive"> 52<parameter name="performative"class="String"direction="fixed"> 53jadex.adapter.fipa.SFipa.INFORM 54 55<parameter name="language"class="String"direction="fixed"> 56jadex.adapter.fipa.SFipa.JAVA_XML 57 58<parameter name="ontology"class="String"direction="fixed"> 59HunterPreyOntology.ONTOLOGY_NAME 60 61<parameter name="content-class"class="Class"direction="fixed"> 62CurrentVision.class 63 64<parameter name="content"class="CurrentVision"/> 65 66 67 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. 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 09<capability name="actsensecap"class="ActSense"/> 10 11 12 13<beliefsetref name="hunters"class="Hunter"exported="true"> 14 15 16<!–similar declarations for obstacles and food omitted for brevity.–> 17<beliefref name="my_self"class="Creature"exported="true"> 18 19 20 21<belief name="eating_allowed"class="boolean"> 22true 23 24 25 26 27<maintaingoal name="keep_alone"exclude="never"> 28<!–details omitted for brevity.–> 29 30 31 32$beliefbase.eating_allowed&&$beliefbase.food.length>0 33 34<!–further details omitted for brevity.–> 35 36<performgoal name="wander_around"retry="true"exclude="never"/> 37 38 39 40 41 42 43 44 45<!–omitted for brevity.–> 46 47 48 49 50 51false 52 53 54 55<initialgoal name="escapegoal"ref="keep_alone"/> 56 57 58 59 60<initialgoal name="wandergoal"ref="wander_around"/> 61<initialgoal name="escapegoal"ref="keep_alone"/> 62 63 64 65 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)

暂无评论。

评论功能维护中,当前仅展示历史评论。