jadex.bdi.planlib.cms.CMSRemoteSearchComponentsPlan 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.planlib.cms;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.bridge.ISearchConstraints;
import jadex.bridge.fipa.CMSSearchComponents;
import jadex.bridge.fipa.Done;
import jadex.bridge.fipa.SFipa;
import jadex.bridge.service.types.cms.IComponentDescription;
/**
* Search for components on a remote platform.
*/
public class CMSRemoteSearchComponentsPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
CMSSearchComponents sa = new CMSSearchComponents();
sa.setComponentDescription((IComponentDescription)getParameter("description").getValue());
sa.setSearchConstraints((ISearchConstraints)getParameter("constraints").getValue());
sa.setRemote(getParameter("remote").getValue()!=null?
((Boolean)getParameter("remote").getValue()).booleanValue(): false);
IGoal req = createGoal("rp_initiate");
req.getParameter("receiver").setValue(getParameter("cms").getValue());
req.getParameter("action").setValue(sa);
req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME);
dispatchSubgoalAndWait(req);
getParameterSet("result").addValues(((CMSSearchComponents)((Done)req.getParameter("result")
.getValue()).getAction()).getComponentDescriptions());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy