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

jadex.bdi.testcases.goals.SubgoalTimeoutPlan 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.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.bdi.runtime.TimeoutException;

/**
 *
 */
public class SubgoalTimeoutPlan extends Plan
{
	/**
	 * The body method is called on the
	 * instatiated plan instance from the scheduler.
	 */
	public void body()
	{
		IGoal sg = createGoal("work_goal");
		try
		{
			dispatchSubgoalAndWait(sg, 1000);
		}
		catch(TimeoutException e)
		{
			getLogger().info("Timeout: "+e);
		}
		getLogger().info("Result is: "+sg.getParameter("result").getValue());
		waitFor(3000);
		getLogger().info("End of timeout plan.");
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy