Jadex 0.941

jadex.tutorial
Capability TranslationD2

Direct Known Containing Agents:
TranslationD2, TranslationE3

capability TranslationD2

TranslationCapability Lesson: D2. Using an exported belief.


Belief Summary
exported beliefset Tuple egwords
           This beliefset contains the english-german dictionary as facts.
 
Plan Summary
standard plan addword()
           Passive plan for adding words, when a request word message is received.
standard plan egtrans()
           Passive plan for translating words, when a request translation message is received.
 
Event Summary
messageevent failure(String performative)
           The answer message after some error occurred.
messageevent inform(String performative)
           The answer message after success.
messageevent request_addword(String content-start, String performative)
           Specifies a add word request being all messages with performative request and start with a specific string "add english_german".
messageevent request_translation(String content-start, String performative)
           Specifies a translation request being all messages with performative request and start with a specific string "translate english_german".
 
Expression Summary
expression query_egword
           This query selects the first matching entry from the dictionary, whereby the parameter $eword is compared to the first element of a belief set tuple.
 

Belief Detail

egwords

exported 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")
new Tuple("puppy", "Hund")
new Tuple("hound", "Hund")
new Tuple("jack", "Katze")
new Tuple("crummie", "Kuh")
Plan Detail

addword

standard plan addword()
Passive plan for adding words, when a request word message is received.

Plan body:
new EnglishGermanAddWordPlanD2()
Message event trigger:
request_addword

egtrans

standard plan egtrans()
Passive plan for translating words, when a request translation message is received.

Plan body:
new EnglishGermanTranslationPlanD2()
Message event trigger:
request_translation
Event Detail

request_addword

messageevent request_addword(String content-start, 
                             String performative)
Specifies a add word request being all messages with performative request and start with a specific string "add english_german".

Parameters:
fixed parameter content-start Default value:  "add english_german"
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

request_translation

messageevent request_translation(String content-start, 
                                 String performative)
Specifies a translation request being all messages with performative request and start with a specific string "translate english_german".

Parameters:
fixed parameter content-start Default value:  "translate english_german"
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

inform

messageevent inform(String performative)
The answer message after success.

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

failure

messageevent failure(String performative)
The answer message after some error occurred.

Parameters:
fixed parameter performative Default value:  SFipa.FAILURE
Event flags:
direction: send
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 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

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.