jadex.bdi.dfagent.DFModifyPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applib-bdi Show documentation
Show all versions of jadex-applib-bdi Show documentation
The Jadex applib BDI package contain
ready to use functionalities for
BDI agents mostly in form of modules
called capabilities.
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