jadex.bdi.testcases.plans.MultipleTesterPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
package jadex.bdi.testcases.plans;
import jadex.base.test.TestReport;
import jadex.bdi.runtime.Plan;
/**
* Test if a plan is triggered once.
*/
public class MultipleTesterPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
TestReport tr = new TestReport("#1", "Tests if a plan is triggered once.");
getBeliefbase().getBelief("bel_a").setFact(new Integer(1));
waitFor(100);
if(((Integer)getBeliefbase().getBelief("plan_cnt").getFact()).intValue()==1)
{
tr.setSucceeded(true);
}
else
{
tr.setReason("More than one plan triggered.");
}
getBeliefbase().getBeliefSet("testcap.reports").addFact(tr);
}
}