All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.planlib.ping.DoPingPlan Maven / Gradle / Ivy

Go to download

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