Jadex 0.941

jadex.tutorial
Agent TranslationG1


agent TranslationG1

TranslationAgent: Lesson G1.

Using a separate thread to accept http connections.

Explanation

The agent opens a server connection at port 9099 and waits for translation requests.
Direct your browser to e.g. http://localhost:9099/dog to perform a translation.


Belief Summary
beliefset Tuple egwords
           This beliefset contains the english-german dictionary as facts.
 
Goal Summary
achievegoal translate(Socket client)
           Translation goal containing the socket for client communication.
 
Plan Summary
standard plan egtrans(Socket client)
           Passive plan for translating a word from English to German.
standard plan server()
           Initial plan for starting a server thread waiting for client connections.
 
Expression Summary
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")
Goal Detail

translate

achievegoal translate(Socket client)
Translation goal containing the socket for client communication.

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

egtrans

standard plan egtrans(Socket client)
Passive plan for translating a word from English to German. Reacts on changes made to the belief set clients.

Parameters:
in parameter client (goal mappings: translate.client)
Plan body:
new EnglishGermanTranslationPlanG1()
Goal Trigger:
translate

server

standard plan server()
Initial plan for starting a server thread waiting for client connections. Adds new sockets with the new connection to the client belief set.

Plan body:
new ServerPlanG1(9099)
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
Initial State Detail

default

default initial state default
Initial Plans:
server

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.