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

jadex.bdi.testcases.events.SimpleEventHandlerPlan 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.events;

import jadex.base.test.TestReport;
import jadex.bdi.runtime.IParameterElement;
import jadex.bdi.runtime.Plan;

/**
 *  This plan stores a test report in the reports belief set.
 */
public class SimpleEventHandlerPlan extends Plan
{
	//-------- methods --------

	/**
	 *  The plan body.
	 */
	public void body()
	{
		String	test	= (String)((IParameterElement)getReason()).getParameter("param").getValue();
		boolean	success	= ((Boolean)getParameter("success").getValue()).booleanValue();
		TestReport	report	= new TestReport(test, "Test reaction to an initial event");
		if(success)
			report.setSucceeded(true);
		else
			report.setFailed("Event did not match");
		getBeliefbase().getBeliefSet("testcap.reports").addFact(report);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy