
jadex.bdi.testcases.misc.SendStreamPlan 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.
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