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

jadex.micro.testcases.InjectedResultsAgent 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;

import jadex.commons.future.IFuture;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.AgentArgument;
import jadex.micro.annotation.AgentBody;
import jadex.micro.annotation.AgentResult;
import jadex.micro.annotation.Argument;
import jadex.micro.annotation.Arguments;
import jadex.micro.annotation.Result;
import jadex.micro.annotation.Results;

@Agent
@Arguments(
{
	@Argument(name="myarg", clazz=String.class, defaultvalue="\"def_val\"")
})
@Results(
{
	@Result(name="myres", clazz=String.class),
	@Result(name="myint", clazz=int.class, defaultvalue="-1")
})
public class InjectedResultsAgent
{
	@AgentArgument(value="myarg")
	@AgentResult
	protected String myres;
	
	@AgentResult(value="myint", convert="\"\"+$value", convertback="Integer.parseInt($value)")
	protected String someint;
	
	/**
	 *  The agent body.
	 */
	@AgentBody
	public IFuture executeBody()
	{
//		System.out.println("myres: "+myres);
//		System.out.println("someint: "+someint);
		
		someint = "99";
		
		return IFuture.DONE;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy