
jadex.bdi.testcases.plans.CountdownPlan 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.
The newest version!
package jadex.bdi.testcases.plans;
import jadex.bdi.runtime.Plan;
/**
* The countdown plan counts down to zero.
*/
public class CountdownPlan extends Plan
{
//-------- constructors --------
/**
* Create a new countdown plan.
*/
public CountdownPlan()
{
getLogger().info("Created: "+this);
}
//-------- methods --------
/**
* The plan body.
*/
public void body()
{
while(true)
{
int num = ((Integer)getBeliefbase().getBelief("num").getFact()).intValue();
getLogger().info(""+num);
getBeliefbase().getBelief("num").setFact(Integer.valueOf(num-1));
waitFor(10);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy