jadex.bdi.cmsagent.CMSSearchComponentsPlan 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.cmsagent;
import jadex.base.fipa.CMSSearchComponents;
import jadex.base.fipa.Done;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.bridge.IComponentDescription;
/**
* Search for components.
*/
public class CMSSearchComponentsPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
CMSSearchComponents sa = (CMSSearchComponents)getParameter("action").getValue();
IGoal sag = createGoal("cms_search_components");
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.setComponentDescriptions((IComponentDescription[])sag.getParameterSet("result").getValues());
getParameter("result").setValue(new Done(sa));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy