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

jadex.gpmn.plan.SequentialActivationPlan Maven / Gradle / Ivy

Go to download

The Jadex applib BDI package contains ready to use functionalities for BDI agents mostly in form of modules called capabilities.

The newest version!
package jadex.gpmn.plan;

import jadex.bdiv3.runtime.IGoal;
import jadex.bdiv3x.runtime.Plan;

/**
 *  Plan for sequential goal activation in GPMN processes.
 *
 */
public class SequentialActivationPlan extends Plan
{
	/**
	 *  The body method is called on the
	 *  instantiated plan instance from the scheduler.
	 */
	public void body()
	{
		String[] goalnames = (String[]) getParameter("goals").getValue();
		IGoal[] goals = new IGoal[goalnames.length];
		for (int i = 0; i < goalnames.length; ++i)
		{
			goals[i] = createGoal(goalnames[i]);
			dispatchSubgoalAndWait(goals[i]);
			if (!goals[i].isSucceeded())
			{
				fail(goals[i].getException());
			}
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy