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

jadex.bdi.planlib.protocols.subscribe.SPReceptionPlan 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.protocols.subscribe;

import jadex.bdiv3.runtime.IGoal;
import jadex.bdiv3x.runtime.IMessageEvent;
import jadex.bdiv3x.runtime.Plan;
import jadex.bridge.fipa.SFipa;

public class SPReceptionPlan extends Plan
{
	public void body()
	{
		IMessageEvent msg = (IMessageEvent) getReason();
		IMessageEvent reply = getEventbase().createReply(msg, "sp_agree");
		sendMessage(reply);
		
		IGoal startSub = createGoal("sp_start_subscription");
		startSub.getParameter("initiator").setValue(msg.getParameter(SFipa.SENDER).getValue());
		startSub.getParameter("subscription_id").setValue(msg);
		startSub.getParameter("subscription").setValue(msg.getParameter(SFipa.CONTENT).getValue());
		dispatchSubgoalAndWait(startSub);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy