jadex.bdi.benchmarks.RequestSenderPlan 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.IGoal;
import jadex.bdi.runtime.Plan;
import jadex.bridge.IComponentManagementService;
import jadex.bridge.IComponentIdentifier;
import jadex.commons.service.SServiceProvider;
/**
* Handle requests and generate reply value.
*/
public class RequestSenderPlan extends Plan
{
public void body()
{
int max = ((Integer)getBeliefbase().getBelief("max").getFact()).intValue();
IComponentIdentifier receiver = (IComponentIdentifier) getBeliefbase().getBelief("receiver").getFact();
long time = System.currentTimeMillis();
long lasttime = System.currentTimeMillis();
for(int i=0; i