
jason.infra.repl.verbose Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jason Show documentation
Show all versions of jason Show documentation
Jason is a fully-fledged interpreter for an extended version of AgentSpeak, a BDI agent-oriented logic programming language.
package jason.infra.repl;
import java.util.logging.Level;
import jason.asSemantics.DefaultInternalAction;
import jason.asSemantics.TransitionSystem;
import jason.asSemantics.Unifier;
import jason.asSyntax.NumberTerm;
import jason.asSyntax.Term;
public class verbose extends DefaultInternalAction {
@Override public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
if (args.length>0 && args[0].isNumeric()) {
NumberTerm n = (NumberTerm)args[0];
switch ((int)n.solve()) {
case 0: ts.getLogger().setLevel(Level.SEVERE); break;
case 1: ts.getLogger().setLevel(Level.INFO); break;
case 2: ts.getLogger().setLevel(Level.FINE); System.out.println("*****");break;
}
return true;
} else {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy