jadex.bdi.planlib.df.DFLocalSearchPlan 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.df;
import jadex.bdi.runtime.Plan;
import jadex.bridge.ISearchConstraints;
import jadex.bridge.service.types.df.IDF;
import jadex.bridge.service.types.df.IDFComponentDescription;
import jadex.commons.future.IFuture;
/**
* Plan to register at the df.
*/
public class DFLocalSearchPlan extends Plan
{
/**
* Plan body.
*/
public void body()
{
// Todo: support other parameters!?
IDFComponentDescription desc = (IDFComponentDescription)getParameter("description").getValue();
ISearchConstraints con = (ISearchConstraints)getParameter("constraints").getValue();
boolean remote = getParameter("remote").getValue()!=null?
((Boolean)getParameter("remote").getValue()).booleanValue(): false;
// todo: support remote search (search on all DFs on remote platforms also).
if(remote)
throw new UnsupportedOperationException("Remote DF search not yet implemented.");
IFuture ret = ((IDF)getServiceContainer().getRequiredService("df").get(this)).search(desc, con);
IDFComponentDescription[] result = (IDFComponentDescription[])ret.get(this);
getParameterSet("result").addValues(result);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy