Jadex 0.941

jadex.tutorial
Agent TranslationE2


agent TranslationE2

TranslationAgent: Lesson E2.

Understanding the goal retry mechanism.

Explanation

The agent has an initial plan that reacts on all requests. It does not handle this reuests by itself but instead creates subgoals and waits for their completion.


Belief Summary
beliefset Tuple efwords
           This beliefset contains the english-french dictionary as facts.
beliefset Tuple egwords
           This beliefset contains the english-german dictionary as facts.
 
Goal Summary
achievegoal translate(String direction, String result, String word)
           Specifies a translation goal type with parameters for the translation direction, the word to translate and the result.
 
Plan Summary
standard plan eftrans(String direction, String result, String word)
           Passive plan for translating words from English to French.
standard plan egtrans(String direction, String result, String word)
           Passive plan for translating words from English to German.
standard plan process()
           Initial plan for handling all message requests.
 
Event Summary
messageevent request_translation(String performative)
           Specifies a translation request being all messages with performative request.
 
Expression Summary
expression query_efword
           This query selects the first matching entry from the English - French dictionary, whereby the parameter $eword is compared to the first element of a belief set tuple.
expression query_egword
           This query selects the first matching entry from the English - German dictionary, whereby the parameter $eword is compared to the first element of a belief set tuple.
 
Initial State Summary
default initial state  default
          
 

Belief Detail

egwords

beliefset Tuple egwords
This beliefset contains the english-german dictionary as facts.

Default facts:
new Tuple("milk", "Milch")
new Tuple("cow", "Kuh")
new Tuple("cat", "Katze")
new Tuple("dog", "Hund")

efwords

beliefset Tuple efwords
This beliefset contains the english-french dictionary as facts.

Default facts:
new Tuple("milk", "lait")
new Tuple("cow", "vache")
new Tuple("cat", "chat")
new Tuple("dog", "chien")
Goal Detail

translate

achievegoal translate(String direction, 
                      String result, 
                      String word)
Specifies a translation goal type with parameters for the translation direction, the word to translate and the result.

Parameters:
in parameter direction
out parameter result
in parameter word
BDI flags:
retry: true
retry delay: 0
exclude: when_tried
random selection: false
meta-level reasoning: true
post to all: false
Plan Detail

process

standard plan process()
Initial plan for handling all message requests. Has the task to create appropriate translation subgoals. Uses a waitqueue to store message events that arrived during the plan was busy.

Plan body:
new ProcessTranslationRequestPlanE2()

egtrans

standard plan egtrans(String direction, 
                     String result, 
                     String word)
Passive plan for translating words from English to German. Reacts on any translation goals.

Parameters:
in parameter direction (goal mappings: translate.direction)
in parameter result (goal mappings: translate.result)
in parameter word (goal mappings: translate.word)
Plan body:
new EnglishGermanTranslationPlanE2()
Goal Trigger:
translate

eftrans

standard plan eftrans(String direction, 
                     String result, 
                     String word)
Passive plan for translating words from English to French. Reacts on any translation goals.

Parameters:
in parameter direction (goal mappings: translate.direction)
in parameter result (goal mappings: translate.result)
in parameter word (goal mappings: translate.word)
Plan body:
new EnglishFrenchTranslationPlanE2()
Goal Trigger:
translate
Event Detail

request_translation

messageevent request_translation(String performative)
Specifies a translation request being all messages with performative request.

Parameters:
fixed parameter performative Default value:  SFipa.REQUEST
Event flags:
direction: receive
message type: fipa
random selection: false
meta-level reasoning: true
post to all: false
Expression Detail

query_egword

expression query_egword
This query selects the first matching entry from the English - German dictionary, whereby the parameter $eword is compared to the first element of a belief set tuple.

Expression:
select one $wordpair.get(1) from Tuple $wordpair in $beliefbase.egwords where $wordpair.get(0).equals($eword)
Parameter:  String $eword

query_efword

expression query_efword
This query selects the first matching entry from the English - French dictionary, whereby the parameter $eword is compared to the first element of a belief set tuple.

Expression:
select one $wordpair.get(1) from Tuple $wordpair in $beliefbase.efwords where $wordpair.get(0).equals($eword)
Parameter:  String $eword
Initial State Detail

default

default initial state default
Initial Plans:
process

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.