All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.testcases.plans.TestInlinePlan Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
package jadex.bdi.testcases.plans;

import jadex.base.test.TestReport;
import jadex.bdi.runtime.GoalFailureException;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;

/**
 *  Create a goal and wait for the result.
 */
public class TestInlinePlan extends Plan
{
	public void body()
	{
		TestReport	report	= new TestReport("test_inline", "Dispatch a goal handled by the inline plan");
		try
		{
			IGoal	agoal	= createGoal("testgoal");
			dispatchSubgoalAndWait(agoal);
			report.setSucceeded(true);
		}
		catch(GoalFailureException gfe)
		{
			report.setReason(gfe.toString());
		}
		getBeliefbase().getBeliefSet("testcap.reports").addFact(report);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy