Categories:
| May 2012 | ||||||
|---|---|---|---|---|---|---|
| S | M | T | W | T | F | S |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Monthly Archives:
Most recent entries:
Syndicate:
AOP JADE configure in Eclipse and NetBeans
This week we started again with school and one of the new lessons we follow talks about Agent Oriented Programming. With Java Agent Development Framework (JADE) we had to show a ‘Hello World’, well getting this to work was less easy than we imagined, so here a small guide with screenshots how we did it.
- Download JADE
http://jade.tilab.com/
Tip: If you don’t want to create an account like me, go to bugmenot.org for a valid login. - Download the complete package
it’s only 12MB :p - Extract the JADE-bin-4.0.1.zip
- Open Eclipse or NetBeans
- Start a new Java-project
- Create the following file
package helloworld; import jade.core.Agent; public class Hello extends Agent { protected void setup() { System.out.println("Hello World. "); System.out.println("My name is "+ getLocalName()); } public Hello() { System.out.println("Constructor called"); } }Note: Mind the package.. and classname
- Set configuration in Eclipse/NetBeans
In Eclipse
Add the library’s to your project as in the following screenshots:
Adjust the Run-configuration as in the following screenshots:
In NetBeans
So what is done?
Well the idea with AOP is that Agents are classes that can perform certain tasks in the whole system. So when the application is started it needs to boot jade.Boot to initialize it’s container for containing Agents and letting everything communicate with eachother. But for jade.Boot to know what Agents to load on boot you add an extra pair of parameters: (With the NetBeans example)
japie:aop.HelloAgent
[agentName]:[packageName].[className]
So you tell jade.Boot to create a new agent with an agent name ‘japie’ (this can be anything) to be added based on the code in the package aop and the class called HelloAgent.





