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

jadex.micro.testcases.semiautomatic.compositeservice.AddService Maven / Gradle / Ivy

Go to download

The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.

There is a newer version: 4.0.267
Show newest version
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 add service.
 */
public class AddService extends BasicService implements IAddService
{
	//-------- constructors --------
	
	/**
	 *  Create the service.
	 */
	public AddService(IInternalAccess comp)
	{
		super(comp.getComponentIdentifier(), IAddService.class, null);
	}
	
	//-------- methods --------

	/**
	 *  Add two numbers.
	 *  @param a Number one.
	 *  @param b Number two.
	 *  @return The sum of a and b.
	 */
	public IFuture add(double a, double b)
	{
		System.out.println("add service called on: "+getServiceIdentifier().getProviderId());
		return new Future(Double.valueOf(a+b));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy