Package cz.cuni.amis.pogamut.shady

Package class diagram package cz.cuni.amis.pogamut.shady
Shady - experimental POSH-like engine.

See:
          Description

Interface Summary
IArgument<T> Interface that unified various arguments used when shade is calling the primitive.
IQuery Interface for getting integer value from some part of the plan, e.g.
ShadyParserConstants Token literal values and constants.
 

Class Summary
ArgString Store the string value as an argument.
NodeCall During the execution of the tree, we have to go from one node to another and finally execute one primitive.
NodeElement Every node has multiple elemnts, binary tree has two, our if-then tree structure has a variable ammount.
QueryCall Query call is used to call some function in outside of engine with some parameters and return the value.
ShadeEngine<EXECUTOR extends IWorkExecutor> This class is taking a shade plan (already parsed in form of ShadeTree and executing it using supplied IWorkExecutor.
ShadeNode Representation of one node in the if-then tree.
ShadeTree This class contains all nodes of one shade plan.
ShadyParser  
ShadyParserTokenManager Token Manager.
SimpleCharStream An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).
Token Describes the input token stream.
 

Exception Summary
ParseException This exception is thrown when parse errors are encountered.
 

Error Summary
TokenMgrError Token Manager Error.
 

Package cz.cuni.amis.pogamut.shady Description

Shady - experimental POSH-like engine.

Shady is a new engine using if-then rules. posh is ugly piece of code that is maintaining compatibility with the version written in lisp and later in Python. That must stop, it is not pretty (in fact, it is distasteful), it has many features that are not used (goals in competences, nested APs) and very few people even have an idea they are there (default goals and such) or even why they are there.

Our students often complain about posh, so do I. I believe that much simples tree engine with simple node structure will be easier to learn and to use. This idea was proposed by Jakub Gemrot alongside with my tasks for master thesis, but I am beat tonight, so it is time for some fun instead of productuive work.

What is difference from posh?

Grammar

fuzzy : '(' node ')'

# NAME is a string in quotes, e.g. "root" or "run on hills"
node : '(' 'node' NAME DESCR (connection)+ ')'

# priority is a call 
connection : '(' PRIORITY trigger call ')'

# Trigger is something that returns either 1 or 0 (instead of true/false)
trigger : '(' 'not' trigger ')'
           '(' 'and' (trigger)+ ')'
           '(' 'or' (trigger)+ ')'
           '(' '>' value value ')'
           '(' '>=' value value ')'
           '(' '=' value value ')'
           '(' '=<' value value ')'
           '(' '<' value value ')'
           call

# Something that returns numerical value, either parameter, constant or call
value : call
        | parameter

 
# call function and return numerical value
call : '(' NAME (PARAMETER)* ')'

parameter : argument | string | number

ARG: '*' (DIGIT)+ '*'
STRING: 
INT: 
NUMBER:

Example :   
(
    (node "root" "Root node for rabbit"
        ((fix 100)  ((hungry)) ("look for food") )
        ((fix 50)   ((succeed)) ("run around") )
        ((scared)   ((succeed)) ("run from closest enemy"))
    )
    
    (node "look for food" "Go around the forrest and look for edible stuff"
        ((fix 10) ) 
    )
)

How is target of call determined:



Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.