jadex.micro.testcases.semiautomatic.compositeservice.SubService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-micro Show documentation
Show all versions of jadex-applications-micro Show documentation
The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.
package jadex.micro.testcases.semiautomatic.compositeservice;
import jadex.bridge.IInternalAccess;
import jadex.bridge.service.BasicService;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;
/**
* Simple subtract service.
*/
public class SubService extends BasicService implements ISubService
{
//-------- constructors --------
/**
* Create a new service.
*/
public SubService(IInternalAccess comp)
{
super(comp.getComponentIdentifier(), ISubService.class, null);
}
//-------- methods --------
/**
* Subtract two numbers.
* @param a Number one.
* @param b Number two.
* @return The result of a minus b.
*/
public IFuture sub(double a, double b)
{
return new Future(Double.valueOf(a-b));
}
}