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

jadex.bdi.dfagent.DFModifyPlan Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.4
Show newest version
package jadex.bdi.dfagent;

import jadex.base.fipa.DFModify;
import jadex.base.fipa.Done;
import jadex.base.fipa.IDFComponentDescription;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;

/**
 *  The df modify plan has the task to receive a message
 *  andc reate a corresponding goal.
 */
public class DFModifyPlan extends Plan
{
	/**
	 * The body method is called on the
	 * instatiated plan instance from the scheduler.
	 */
	public void body()
	{
		DFModify mo = (DFModify)getParameter("action").getValue();

		IGoal reg = createGoal("df_modify");
		reg.getParameter("description").setValue(mo.getComponentDescription());
		dispatchSubgoalAndWait(reg);

		mo.setResult((IDFComponentDescription)reg.getParameter("result").getValue());
		getParameter("result").setValue(new Done(mo));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy