Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jason.stdlib;
 

Internal action: .list_plans.

Description: prints out the plans in the plan library.

Parameter:

  • + trigger (trigger term, [optional]): list only plan that unifies this parameter as trigger event.

Examples:

  • .list_plans
  • .list_plans({ +g(_) })
public class list_plans extends DefaultInternalAction {
    @Override public Object execute(TransitionSystem tsUnifier unTerm[] argsthrows Exception {
        Trigger te = null;
        if (args.length == 1 && args[0] instanceof Trigger)
            te = Trigger.tryToGetTrigger(args[0]);
        
        for (Plan pts.getAg().getPL()) {
            if (!p.getLabel().toString().startsWith("kqml")) { // do not list kqml plans
                if (te == null || new Unifier().unifies(p.getTrigger(), te)) {
                    ts.getLogger().info(p.toString());
                }
            }
        }
        return true;
    }
New to GrepCode? Check out our FAQ X