The Action Plugin and Action Addon Framework


The Robot Action Addon

The Robot Action Addon is a toy example which demostrates movements of a robot under the following scenario: a robot stands at the center of a U shaped corridor. in the evenings, depending on the amount of fuel it has, it will either patrol both legs of the corridor or just one leg of it (left or right) and after that it will turn the alarm on. In the mornings, it will turn the alarm off. The robot action addon provides a single atom #robot. It takes two inputs where former is the action name and the latter is the option related to action:

#robot[A, AO]{O,P}
Input:
A
action type, either move or turnAlarm
AO
option related to given action by A

#robot action atom will allow user to control a toy robot simulation on the shell. Action move can be used with one of the three options: left, right and all where as action turnAlarm can be used one of the two options: on and off. By specifying the action type to move, robot will be able to move in an "U" shaped corridor. In the case the action option is left (resp. right robot will patrol the left (resp. right) leg of the corridor and in the case action option is given as all, the robot will patrol both legs of the corridor. On the other hand if the action type is specified to turnAlarm, depending on the action option (either on or off, the alarm will be turned on or off.

Example:

 #robot[move, all]{c, 1} :- fuel(full).
 #robot[move, right]{c, 1} v #robot[move, left] {b, 1} :- not fuel(full).
 #robot[turnAlarm, on]{b, 2} :- night.

Note that O (resp. P) are option (resp. precedence) that appears in action atoms. Additionally, mentioned action atoms can be combined with weight and and level.


In the latest version we added an External Atom:
&sense[fuel](X)
Input:
fuel
can assume only this value

Output:
X
the level of fuel, may assume either the value low or the value high.


You can check it out its source here.

For other action addons return to the section Action Addons of The Action Plugin and Action Addon Framework.



Last edited 2013-04-23

 

General
dlvhex source code @ github.com
Description-Of-A-Project

Popular Plugins
Action Plugin
DecisionDiagrams Plugin
Description Logics Plugin
Description Logics Lite Plugin
MELD: Belief Merging Plugin
Nested HEX Plugin
MCSIE Plugin
String Plugin
dlvhex-semweb Project

Documentation
User Guide
README
doxygen
Writing Plugins in C++
Writing Plugins in Python