@Agent @Configurations({@Configuration(name="1"),@Configuration(name="2")}) public class ObjectConditionBDI
if(!configdone.contains(config.name())) ConfigurationInfo configinfo = (ConfigurationInfo)confs.get(config.name()); if(config.replace()) configdone.add(config.name()); if(configinfo==null) configinfo = new ConfigurationInfo(config.name()); confs.put(config.name(), configinfo); configinfo.setMaster(config.master().toBoolean()); if(configinfo.getDaemon()==null) configinfo.setDaemon(config.daemon().toBoolean()); if(configinfo.getAutoShutdown()==null) configinfo.setAutoShutdown(config.autoshutdown().toBoolean()); if(configinfo.getSynchronous()==null) configinfo.setSynchronous(config.synchronous().toBoolean()); if(configinfo.getPersistable()==null) configinfo.setPersistable(config.persistable().toBoolean()); if(configinfo.getSuspend()==null) configinfo.setSuspend(config.suspend().toBoolean()); if(configinfo.getScope()==null && !RequiredServiceInfo.SCOPE_GLOBAL.equals(config.scope())) configinfo.setScope(config.scope()); NameValue[] argvals = config.arguments(); for(int j=0; j<argvals.length; j++) NameValue[] resvals = config.results(); for(int j=0; j<resvals.length; j++)
if(!configdone.contains(config.name())) ConfigurationInfo configinfo = (ConfigurationInfo)confs.get(config.name()); if(config.replace()) configdone.add(config.name()); if(configinfo==null) configinfo = new ConfigurationInfo(config.name()); confs.put(config.name(), configinfo); configinfo.setMaster(config.master()); if(configinfo.getDaemon()==null) configinfo.setDaemon(config.daemon()); if(configinfo.getAutoShutdown()==null) configinfo.setAutoShutdown(config.autoshutdown()); if(configinfo.getSuspend()==null) configinfo.setSuspend(config.suspend()); NameValue[] argvals = config.arguments(); for(int j=0; j<argvals.length; j++) NameValue[] resvals = config.results(); for(int j=0; j<resvals.length; j++) ProvidedService[] provs = config.providedservices(); RequiredService[] reqs = config.requiredservices(); Component[] comps = config.components();
@Agent @Configurations({@Configuration(name="1"),@Configuration(name="2")}) public class ObjectConditionJavaBeansBDI
/** * Test if pojo services can be passed as local parameters. */ @Agent @ProvidedServices(@ProvidedService(type=IDService.class, implementation=@Implementation(PojoDService.class))) @RequiredServices(@RequiredService(name="cms", type=IComponentManagementService.class, binding=@Binding(scope=Binding.SCOPE_PLATFORM))) @Results(@Result(name="testresults", clazz=Testcase.class)) @Configurations({@Configuration(name="first"), @Configuration(name="second")}) public class ServiceParameterAgent { }
@Configurations({@Configuration(name="sunny"), @Configuration(name="rainy")}) @Agent(keepalive=Boolean3.FALSE) public class UniversityBDI
/** * Component that holds the sensors in the platform. */ @Agent @ComponentTypes( { @ComponentType(name="cpusensor", filename="jadex/platform/sensor/system/SystemSensorAgent.class") }) @Configurations(@Configuration(name="def", components= { @Component(type="cpusensor") })) public class SensorHolderAgent { }
/** * Simple test agent with one service. */ @Agent @ComponentTypes( { @ComponentType(name="emptya", clazz=EmptyAAgent.class), @ComponentType(name="emptyb", clazz=EmptyBAgent.class) }) @Configurations( { @Configuration(name="main", components= { @Component(type="emptya", number="1"), @Component(type="emptyb", number="1") }), @Configuration(name="same", components= { @Component(type="emptya", number="1"), @Component(type="emptyb", number="1") }) }) public class MainAgent { }
/** * Application configurations with users and providers. */ @Agent @ComponentTypes({ @ComponentType(name="user", clazz=UserAgent.class), @ComponentType(name="provider", clazz=ProviderAgent.class) }) @Configurations({ @Configuration(name="10 users and 5 providers", components={ @Component(name="gui", type="user", configuration="with gui"), @Component(type="user", number="10"), @Component(type="provider", number="5") }), @Configuration(name="40 users and 5 providers", components={ @Component(name="gui", type="user", configuration="with gui"), @Component(type="user", number="40"), @Component(type="provider", number="5") }) }) public class ApplicationAgent { }
/** * Component that holds the sensors in the platform. */ @Agent @ComponentTypes( { @ComponentType(name="cpusensor", filename="jadex/platform/sensor/system/SystemSensorAgent.class") }) @Configurations(@Configuration(name="def", components= { @Component(type="cpusensor") })) @Properties(@NameValue(name="system", value="true")) public class SensorHolderAgent { }
@Configuration(name="a", requiredservices=@RequiredService(name="as", type=IAService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_LOCAL))), @Configuration(name="b") }) @Results(@Result(name="testresults", clazz=Testcase.class))
@Configuration(name="self"), @Configuration(name="platform")}) @RequiredServices({ @RequiredService(name="sub", type=IAutoTerminateService.class,
/** * Base class agent. */ @Agent @Description("Base description") @Imports({"b1", "b2"}) @Properties({@NameValue(name="a", value="\"ba\""), @NameValue(name="b", value="\"bb\"")}) @RequiredServices(@RequiredService(name="clock", type=IClockService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @ProvidedServices(@ProvidedService(name="myservice", type=IAService.class, implementation=@Implementation(Object.class))) @Arguments(@Argument(name="arg1", defaultvalue="\"bval\"", clazz=String.class)) @Results(@Result(name="res1", defaultvalue="\"bres\"", clazz=String.class)) @Configurations({@Configuration(name="config1"), @Configuration(name="config2")}) public abstract class BaseAgent { }
@Configurations({@Configuration(name="default"), @Configuration(name="with gui")})
@RequiredServices(@RequiredService(name="cms", type=IComponentManagementService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @Configurations({@Configuration(name="default"), @Configuration(name="created")}) @ProvidedServices(@ProvidedService(type=ITestService.class)) @Service
@ComponentTypes({ @ComponentType(name="Generator", filename="jadex/micro/examples/mandelbrot/GenerateAgent.class"), @ComponentType(name="Calculator", filename="jadex/micro/examples/mandelbrot/CalculateAgent.class"), @ComponentType(name="Display", filename="jadex/micro/examples/mandelbrot/DisplayAgent.class") }) @Configurations( @Configuration(name="default", components={ @Component(type="Generator"), @Component(type="Calculator"), @Component(type="Display") }) ) @Agent public class MandelbrotAgent { }
/** * Chat micro agent. */ @Description("This agent offers a chat service.") @ProvidedServices({ @ProvidedService(name="chat", type=IChatService.class, implementation=@Implementation(ChatService.class)), @ProvidedService(name="chatgui", type=IChatGuiService.class, implementation=@Implementation(expression="$component.getComponentFeature(jadex.bridge.service.component.IProvidedServicesFeature.class).getProvidedServiceRawImpl(\"chat\")")) }) @RequiredServices( @RequiredService(name="chatservices", type=IChatService.class, multiple=true, binding=@Binding(dynamic=true, scope=Binding.SCOPE_GLOBAL)) ) @Arguments(@Argument(name="nosave", clazz=boolean.class, description="Don't save settings.")) @Agent @Properties(@NameValue(name="system", value="\"system\".equals($config)")) @Configurations({@Configuration(name="system"), @Configuration(name="user")}) public class ChatAgent { // @Agent // protected IInternalAccess agent; // // @AgentCreated // public void body() // { // System.out.println("config: "+agent.getConfiguration()); // } }
@Configurations( @Configuration(name="main", components= @Configuration(name="same", components=
@Configuration(name="a", providedservices=@ProvidedService(type=IAService.class, implementation=@Implementation(expression="$pojoagent.getService()"))), @Configuration(name="b") }) @Results(@Result(name="testresults", clazz=Testcase.class))
@ComponentTypes(@ComponentType(name="chat", filename="jadex/platform/service/chat/ChatAgent.class")) // Hack!!! Implicit dependency to jadex-platform @Configurations({ @Configuration(name="intern", components=@Component(type="chat", arguments=@NameValue(name="nosave", value="true"), configuration="user")), @Configuration(name="extern") }) @RequiredServices({