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

jadex.bdi.testcases.misc.SendStreamPlan Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

The newest version!
package jadex.bdi.testcases.misc;

import jadex.bdi.runtime.Plan;
import jadex.bridge.IOutputConnection;
import jadex.bridge.service.RequiredServiceInfo;
import jadex.bridge.service.types.message.IMessageService;

/**
 * 
 */
public class SendStreamPlan extends Plan
{
	 /**
	  *  The plan body.
	  */
	public void body()
	{
		IMessageService ms = getServiceContainer().searchService(IMessageService.class, RequiredServiceInfo.SCOPE_PLATFORM).get(this);
		IOutputConnection con = ms.createOutputConnection(getComponentIdentifier(), getComponentIdentifier(), null).get(this);

		for(int i=0; i<5; i++)
		{
			con.write(new byte[]{(byte)i});
			waitFor(1000);
		}
		
		con.close();
	}
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy