jadex.bdi.testcases.plans.MicroStepPlan 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;
/**
* Testing micro steps.
*/
public class MicroStepPlan extends Plan
{
//-------- methods --------
/**
* The body method.
*/
public void body()
{
TestReport tr = new TestReport("#1", "Testing micro steps. There are 3 conditions a, b, and(a,b) that should trigger immediately.");
getLogger().info("Testing micro steps. There are 3 conditions a, b, and(a,b) that should trigger immediately.");
int plan_cnt1 = getPlanbase().getPlans().length;
getLogger().info("Plan: Setting a to true.");
getBeliefbase().getBelief("a").setFact(new Boolean(true));
int plan_cnt2 = getPlanbase().getPlans().length;
getLogger().info("Plan: a is now true.");
getLogger().info("Plan: Setting b to true.");
getBeliefbase().getBelief("b").setFact(new Boolean(true));
int plan_cnt3 = getPlanbase().getPlans().length;
getLogger().info("Plan: b is now true.");
getLogger().info("Step 1 finished.");
if(plan_cnt1