Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jason.asSyntax.patterns.goal;
 
 
Implementation of the Backtracking Declarative Goal pattern (see DALT 2006 paper)

Author(s):
jomi
public class BDG extends DG {
    static Logger logger = Logger.getLogger(BDG.class.getName());
    
    public Agent process(Pred directiveAgent outerContentAgent innerContent) {
        try {
            // apply DG in the inner plans
            Agent newAg = super.process(directiveouterContentinnerContent); 
            if (newAg != null) {
                Term goal = directive.getTerm(0);
    
                // add -!g : true <- !!g.
                newAg.getPL().add(ASSyntax.parsePlan("-!"+goal+" <- !!"+goal+"."));
                
                return newAg;
            }
        } catch (Exception e) {
            .log(.,"Directive error."e);
        }
        return null;
    }
New to GrepCode? Check out our FAQ X