jadex.bdi.planlib.ping.DoPingPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-applib-bdi Show documentation
Show all versions of jadex-applications-applib-bdi Show documentation
The Jadex applib BDI package contains ready to use functionalities for BDI agents mostly in form of modules called capabilities.
The newest version!
package jadex.bdi.planlib.ping;
import jadex.bdiv3.runtime.IGoal;
import jadex.bdiv3x.runtime.Plan;
/**
* Send a ping and wait for the reply.
*/
public class DoPingPlan extends Plan
{
/**
* The body method is called on the
* instantiated plan instance from the scheduler.
*/
public void body()
{
// long timeout;
// if(getParameter("timeout").getValue()!=null)
// timeout = ((Long)getParameter("timeout").getValue()).longValue();
// else
// timeout = -1;
// Send ping and wait for answer.
IGoal query = createGoal("procap.qp_initiate");
query.getParameter("receiver").setValue(getParameter("receiver").getValue());
query.getParameter("timeout").setValue(getParameter("timeout").getValue());
query.getParameter("action").setValue(getParameter("content").getValue());
dispatchSubgoalAndWait(query);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy