Download Latest Version aimlGOAP-0.1.0.tar.gz (12.9 kB)
Email in envelope

Get an email when there's a new version of aimlGOAP

Home
Name Modified Size InfoDownloads / Week
README.txt 2018-03-28 3.6 kB
aimlGOAP-0.1.0.tar.gz 2018-03-28 12.9 kB
Totals: 2 Items   16.5 kB 0
aimlGOAP v0.1.0

aimlGOAP is a GOAP implementation for AIML bots.  It requires PyGOAPng v0.3.1.

Goals are defined using the Bot.add_goal() function.  To add a goal
that the bot should try to learn the user's name, add a goal like this:

bot = Bot("Alice")
bot.add_goal(DefinedVariableGoal("name"))

Once the "name" tag has been defined in the bot's blackboard, the bot will
stop trying to generate responses that attempt to determine the value of
the "name" variable.

To define the "name" variable, use something like this:

tag = Tag(name="John Smith")
bot.bb.post(tag)

Multiple goals can be active at the same time.

Actions are defined in the aimlgoap/bot/actions.py file which contains 
two classes for each variable that the bot tries to define:

class username(ActionBuilder)
      username.get_actions()
          If the "name" variable is not defined, this function will return a 
          CallableAction that can be used to attempt to define the variable.
      username.build_action()
          This function is invoked to create the CallableAction for this
          class.  It defines the effect of taking the action - namely that
          it expects the "name" variable to be defined.

class username_action(CallableAction)
      __init__()
         Defines the "cost" of the action (generally 1, but more "expensive"
         actions can have a higher cost, making them less likely to be 
         chosen), the prerequisites for this action to complete (that the
         "name" variable is defined), and an array of aiml_patterns which 
         can be output to provoke the user into providing a response that 
         an AIML bot can use to determine the appropriate value for the 
         "name" variable.  Today these are just text output, but in the future
         they will be full templates that can contain AIML markup.
      start()
         Sets the state to running and calls update().
      update()
         Executes any action that the GOAP planner may need before determining
         if the goal has been properly satisfied.  In the case of a
         DefinedVariableGoal all it needs to do is test to see if the variable
         has been set in the bot's blackboard.  If so, it calls finish().
      finish()
         For each effect defined in the ActionBuilder's build_action() 
         function, apply any changes to the bot that are necessary.  In the
         case of a DefinedVariableGoal, there is nothing to do since the
         variable has already been defined by the time the code gets here.
         Next it sets the current_response to blank and changes the
         state to finished.

The first class (the ActionBuilder) must be added to the exported_actions
array in order to make the action available to the bot to GOAP planner.

Multiple actions can be added to exported_actions which satisfy the same
goals.  This will give the GOAP planner more choices.

In a future release, the actions will be defined in a simple XML file which
will make development of goals and actions easier, and the aimlGOAP library
will return AIML markup which can be parsed by an AIML interpretter instead
of returning plain text.

The aiml.goap.test.py script provides an example of how the bot changes its
line of questioning when a goal is fulfilled.

The aiml.goap.bot.py script shows how to integrate the aimlGOAP module into 
a PyAIMLng bot like ANGie.

Links to other projects:

PyGOAPng: http://pygoapng.sourceforge.net/
PyAIMLng: http://pyaimlng.sourceforge.net/
ANGie: http://angiebot.sourceforge.net/

Source: README.txt, updated 2018-03-28