Quantcast

Fwd: Creating JADE agent programmatically

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Creating JADE agent programmatically

Rafael H Bordini-2
-------- Original Message --------
Subject: Creating JADE agent programmatically
From: "Goedym" <[hidden email]>
Date: Thu, 3 Feb 2011 12:12:35 -0800
To: <[hidden email]>

Does anyone have an example they can share of creating a JADE agent
programmatically.  I've seen the examples of starting them from the command
line, using jade.Boot, and I'd like to do the same thing within a java
method.  I thought I'd use the JadeFactory to create an instance of
JadeRuntimeServices, but it sets the ContainerController and Agent to null.
The constructor for JadeRuntimeServices isn't public, so I can't call that.


Thanks in advance for any suggestions.

Goe

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Creating JADE agent programmatically

Jomi Fred Hubner-4
Hi Goe,

I guess you can call the jade.Boot.main method from any java program, as you do from command line....

An alternative (maybe more complex) is to look how we start JADE agents in the Jason/Jade infrastructure, it is coded in the class  jason.infra.jade.RunJadeMAS

HTH,

Jomi

On 03/02/2011, at 22:08, Rafael H Bordini wrote:

> -------- Original Message --------
> Subject: Creating JADE agent programmatically
> From: "Goedym" <[hidden email]>
> Date: Thu, 3 Feb 2011 12:12:35 -0800
> To: <[hidden email]>
>
> Does anyone have an example they can share of creating a JADE agent
> programmatically.  I've seen the examples of starting them from the command
> line, using jade.Boot, and I'd like to do the same thing within a java
> method.  I thought I'd use the JadeFactory to create an instance of
> JadeRuntimeServices, but it sets the ContainerController and Agent to null.
> The constructor for JadeRuntimeServices isn't public, so I can't call that.
>
>
> Thanks in advance for any suggestions.
>
> Goe
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Creating JADE agent programmatically

Goedym
Thanks, Jomi.  I actually went the second route, and I think I have most of
it figured out.

I'm using the using-only-jason-BDI-engine demo as a starting point for
creating an AgArch class.  I'm not using the main method because it's being
instantiated by JadeAgArch.  I found that if I fire off a separate thread
for my SimpleJasonAgent (similar to what happens in the main method, only
I'm now doing it in initAg), that things actually work and I can see the
reasoning cycle happening, hit breakpoints in the act and perceive methods.
I'm wondering if that should be necessary as I see two threads in my
debugger, one for the AgArch method (SimpleJasonAgent) and one for the
JadeAgArch instance.  I don’t fully understand the architecture yet, so I'm
not sure if this makes sense.  It is working for me this way, but if I've
somehow introduced unneeded complexity and overhead, I'd like to figure out
how to trim it down.

Thanks again.

Goe

-----Original Message-----
From: Jomi Fred Hubner [mailto:[hidden email]]
Sent: Wednesday, February 09, 2011 8:00 AM
To: [hidden email]
Subject: Re: [Jason-users] Fwd: Creating JADE agent programmatically

Hi Goe,

I guess you can call the jade.Boot.main method from any java program, as you
do from command line....

An alternative (maybe more complex) is to look how we start JADE agents in
the Jason/Jade infrastructure, it is coded in the class
jason.infra.jade.RunJadeMAS

HTH,

Jomi

On 03/02/2011, at 22:08, Rafael H Bordini wrote:

> -------- Original Message --------
> Subject: Creating JADE agent programmatically
> From: "Goedym" <[hidden email]>
> Date: Thu, 3 Feb 2011 12:12:35 -0800
> To: <[hidden email]>
>
> Does anyone have an example they can share of creating a JADE agent
> programmatically.  I've seen the examples of starting them from the
command
> line, using jade.Boot, and I'd like to do the same thing within a java
> method.  I thought I'd use the JadeFactory to create an instance of
> JadeRuntimeServices, but it sets the ContainerController and Agent to
null.
> The constructor for JadeRuntimeServices isn't public, so I can't call
that.
>
>
> Thanks in advance for any suggestions.
>
> Goe
>
>
----------------------------------------------------------------------------
--
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical
server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Jason-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jason-users

--
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil
http://www.das.ufsc.br/~jomi


----------------------------------------------------------------------------
--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Loading...