jadex.bdi.benchmarks.RequestReceiverPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
package jadex.bdi.benchmarks;
import jadex.bdi.runtime.Plan;
/**
* Handle requests and generate reply value.
*/
public class RequestReceiverPlan extends Plan
{
public void body()
{
// Simple challenge response scheme allowing the initiator to check,
// if the right request was answered.
Integer challenge = (Integer) getParameter("action").getValue();
int response = challenge.intValue() + 1;
getParameter("result").setValue(new Integer(response));
}
}