
test.TSTest 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 test;
import jason.JasonException;
import jason.architecture.AgArch;
import jason.asSemantics.Agent;
import jason.asSemantics.Circumstance;
import jason.asSemantics.Intention;
import jason.asSemantics.InternalAction;
import jason.asSemantics.Option;
import jason.asSemantics.TransitionSystem;
import jason.asSyntax.ASSyntax;
import jason.asSyntax.ArithFunctionTerm;
import jason.asSyntax.InternalActionLiteral;
import jason.asSyntax.Literal;
import jason.asSyntax.Plan;
import jason.asSyntax.Structure;
import jason.asSyntax.Trigger;
import jason.asSyntax.parser.ParseException;
import jason.runtime.Settings;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import junit.framework.TestCase;
/** JUnit test case for syntax package */
public class TSTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
}
public void testRelevant() throws ParseException, JasonException {
Agent ag = new Agent();
ag.initAg();
ag.getPL().add(ASSyntax.parsePlan("@t1 +a(X) : g(10) <- .print(\"ok 10\")."), new Structure("nosource"), false);
ag.getPL().add((Plan)ASSyntax.parseTerm("{ @t2 +a(X) : true <- .print(\"ok 20\") }"), new Structure("nosource"), false);
ag.getPL().add(ASSyntax.parsePlan("@t3 +b : true <- true."), new Structure("nosource"), false);
TransitionSystem ts = ag.getTS();
Literal content = Literal.parseLiteral("~alliance");
content.addSource(new Structure("ag1"));
Trigger te1 = ASSyntax.parseTrigger("+a(10)");
try {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy