jadex.bdi.dfagent.DFSearchPlan 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.DFSearch;
import jadex.base.fipa.Done;
import jadex.base.fipa.IDFComponentDescription;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
/**
* The df search plan has the task to receive a message
* andc reate a corresponding goal.
*/
public class DFSearchPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
DFSearch sa = (DFSearch)getParameter("action").getValue();
IGoal sag = createGoal("df_search");
sag.getParameter("description").setValue(sa.getComponentDescription());
sag.getParameter("constraints").setValue(sa.getSearchConstraints());
sag.getParameter("remote").setValue(sa.isRemote()? Boolean.TRUE: Boolean.FALSE);
dispatchSubgoalAndWait(sag);
sa.setResults((IDFComponentDescription[])sag.getParameterSet("result").getValues());
getParameter("result").setValue(new Done(sa));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy