jadex.bdi.planlib.NotUnderstoodPlan 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;
import jadex.base.fipa.SFipa;
import jadex.bdi.runtime.IMessageEvent;
import jadex.bdi.runtime.IParameterElement;
import jadex.bdi.runtime.Plan;
/**
* Send a not-understood message when
* no other plan is able to handle a message.
*/
public class NotUnderstoodPlan extends Plan
{
//-------- constructors --------
/**
* Create a new plan.
*/
public NotUnderstoodPlan()
{
getLogger().info("Created: "+this);
}
//-------- methods --------
/**
* Execute the plan.
*/
public void body()
{
IMessageEvent rep = getEventbase().createReply((IMessageEvent)getReason(), "not_understood");
rep.getParameter(SFipa.CONTENT).setValue(((IParameterElement)getReason()).getParameter(SFipa.CONTENT).getValue());
sendMessage(rep);
// sendMessage(((IMessageEvent)getReason()).createReply(
// "not_understood", getReason().getParameter(SFipa.CONTENT).getValue()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy