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

jadex.bdi.testcases.goals.MaintainTestPlan Maven / Gradle / Ivy

Go to download

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

The newest version!
package jadex.bdi.testcases.goals;

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


/**
 *  Test creating / suspending maintain goals.
 */
public class MaintainTestPlan extends Plan
{
	/**
	 *  Plan body.
	 */
	public void body()
	{
		// Create and dispatch goal.
		TestReport	report	= new TestReport("dispatch_maintain", "Dispatch a maintain goal that should start processing.");
		getLogger().info("Creating goal");
		IGoal	maintain	= createGoal("maintain");
		dispatchSubgoal(maintain);
		// Wait for goal to be in process.
		waitFor(100);
		if(((Number)getBeliefbase().getBelief("count").getFact()).intValue()>=5
			|| ((Number)getBeliefbase().getBelief("count").getFact()).intValue()<=0)
			report.setReason("Belief should be 0




© 2015 - 2025 Weber Informatics LLC | Privacy Policy