askOne and multiple agents

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

askOne and multiple agents

Marcos Côrtes
Hello... I need a help...

I have tried build a ContractNet example with jason..

But, I need make a "send message" for multiples receivers and receive ALL their answers.

Example:

.send([a, b, c], askOne, ask(), ANSWERS);
//wait the all answers in ANSWERS.
for(.member(A, ANSWERS))
{
    //manipulate a unique answer A in ANWERS
}


I try use the .send internal action with "askOne", but it only wait the first answer for return to the intention/plan.


There is other way to make it? (I do now my agent send and receive the askOne answer for each agent receiver with multiples ".send". But it is very slow!).


Thanks.

--
Ass: Marcos Côrtes
Mestrando Computação - UFF

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|

Re: askOne and multiple agents

Jomi Hubner
Hello Marcos,

the latest version of Jason (1.3.5), just released, supports synchronous ask with several receivers. All the answers are collected into a list. For instance, in

        .send([b,c],askOne,vl(_),L)

L will unify with

        [vl(1)[source(b)],vl(2)[source(c)]]

HTH,

Jomi


On 08/09/2011, at 16:39, Marcos Côrtes wrote:

> Hello... I need a help...
>
> I have tried build a ContractNet example with jason..
>
> But, I need make a "send message" for multiples receivers and receive ALL their answers.
>
> Example:
>
> .send([a, b, c], askOne, ask(), ANSWERS);
> //wait the all answers in ANSWERS.
> for(.member(A, ANSWERS))
> {
>    //manipulate a unique answer A in ANWERS
> }
>
>
> I try use the .send internal action with "askOne", but it only wait the first answer for return to the intention/plan.
>
>
> There is other way to make it? (I do now my agent send and receive the askOne answer for each agent receiver with multiples ".send". But it is very slow!).
>
>
> Thanks.
>
> --
> Ass: Marcos Côrtes
> Mestrando Computação - UFF
> ------------------------------------------------------------------------------
> Doing More with Less: The Next Generation Virtual Desktop
> What are the key obstacles that have prevented many mid-market businesses
> from deploying virtual desktops?   How do next-generation virtual desktops
> provide companies an easier-to-deploy, easier-to-manage and more affordable
> virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/_______________________________________________
> 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


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|

Re: askOne and multiple agents

Marcos Côrtes
I thank you :) (and sorry my english...)

I have used this version...

But I have tried the .asl:

[code]
// Agent sample in project TaskAlloc

/* Initial beliefs and rules */

/* Initial goals */
!generateA.
//!sendIt.
/* Plans */

+!generateA:.my_name(M)<-
+a(M);
.wait(100);
!sendIt.

+!sendIt:.all_names(AGENTS)<-
.send(AGENTS, askOne, a(_), LIST);
.print("List is: ", LIST);
+list(LIST);
.
[/code]


And I only receive the first answer of receivers :/

I looked the code and i think the problem is in TansitionSystem.java@238 line:

[code] if (send.getTerm(0).isList()) { // send to many receivers [/code]

the term in position 0 (when I run the asl code) is of VarTerm class and does not a "List" term.

If I use the .send internal action in this way:".send([a,b], askOne, a(_), LIST);" it work because I use a explicit list. :(


Well, is there one way to I use the .send with VarTerm? I need it because in my problem I do a pre-proccess in the  AGENTS list to select a sublist to send the askOne message.

best regards....

Marcos Côrtes

2011/9/8 Jomi Hubner <[hidden email]>
Hello Marcos,

the latest version of Jason (1.3.5), just released, supports synchronous ask with several receivers. All the answers are collected into a list. For instance, in

       .send([b,c],askOne,vl(_),L)

L will unify with

       [vl(1)[source(b)],vl(2)[source(c)]]

HTH,

Jomi


On 08/09/2011, at 16:39, Marcos Côrtes wrote:

> Hello... I need a help...
>
> I have tried build a ContractNet example with jason..
>
> But, I need make a "send message" for multiples receivers and receive ALL their answers.
>
> Example:
>
> .send([a, b, c], askOne, ask(), ANSWERS);
> //wait the all answers in ANSWERS.
> for(.member(A, ANSWERS))
> {
>    //manipulate a unique answer A in ANWERS
> }
>
>
> I try use the .send internal action with "askOne", but it only wait the first answer for return to the intention/plan.
>
>
> There is other way to make it? (I do now my agent send and receive the askOne answer for each agent receiver with multiples ".send". But it is very slow!).
>
>
> Thanks.
>
> --
> Ass: Marcos Côrtes
> Mestrando Computação - UFF
> ------------------------------------------------------------------------------
> Doing More with Less: The Next Generation Virtual Desktop
> What are the key obstacles that have prevented many mid-market businesses
> from deploying virtual desktops?   How do next-generation virtual desktops
> provide companies an easier-to-deploy, easier-to-manage and more affordable
> virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/_______________________________________________
> 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




--
Ass: Marcos Côrtes
Mestrando Computação - UFF

------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|

Re: askOne and multiple agents

Jomi Hubner
Dear Marcos,

thanks for debugging the code. It is indeed a bug. I fixed it in the SVN of Jason

you can also find a copy of jason.jar at
(simply replace your jason.jar by the above)

HTH,

Jomi

On 09/09/2011, at 15:31, Marcos Côrtes wrote:

I thank you :) (and sorry my english...)

I have used this version...

But I have tried the .asl:

[code]
// Agent sample in project TaskAlloc

/* Initial beliefs and rules */

/* Initial goals */
!generateA.
//!sendIt.
/* Plans */

+!generateA:.my_name(M)<-
+a(M);
.wait(100);
!sendIt.

+!sendIt:.all_names(AGENTS)<-
.send(AGENTS, askOne, a(_), LIST);
.print("List is: ", LIST);
+list(LIST);
.
[/code]


And I only receive the first answer of receivers :/

I looked the code and i think the problem is in TansitionSystem.java@238 line:

[code] if (send.getTerm(0).isList()) { // send to many receivers [/code]

the term in position 0 (when I run the asl code) is of VarTerm class and does not a "List" term.

If I use the .send internal action in this way:".send([a,b], askOne, a(_), LIST);" it work because I use a explicit list. :(


Well, is there one way to I use the .send with VarTerm? I need it because in my problem I do a pre-proccess in the  AGENTS list to select a sublist to send the askOne message.

best regards....

Marcos Côrtes

2011/9/8 Jomi Hubner <[hidden email]>
Hello Marcos,

the latest version of Jason (1.3.5), just released, supports synchronous ask with several receivers. All the answers are collected into a list. For instance, in

       .send([b,c],askOne,vl(_),L)

L will unify with

       [vl(1)[source(b)],vl(2)[source(c)]]

HTH,

Jomi


On 08/09/2011, at 16:39, Marcos Côrtes wrote:

> Hello... I need a help...
>
> I have tried build a ContractNet example with jason..
>
> But, I need make a "send message" for multiples receivers and receive ALL their answers.
>
> Example:
>
> .send([a, b, c], askOne, ask(), ANSWERS);
> //wait the all answers in ANSWERS.
> for(.member(A, ANSWERS))
> {
>    //manipulate a unique answer A in ANWERS
> }
>
>
> I try use the .send internal action with "askOne", but it only wait the first answer for return to the intention/plan.
>
>
> There is other way to make it? (I do now my agent send and receive the askOne answer for each agent receiver with multiples ".send". But it is very slow!).
>
>
> Thanks.
>
> --
> Ass: Marcos Côrtes
> Mestrando Computação - UFF
> ------------------------------------------------------------------------------
> Doing More with Less: The Next Generation Virtual Desktop
> What are the key obstacles that have prevented many mid-market businesses
> from deploying virtual desktops?   How do next-generation virtual desktops
> provide companies an easier-to-deploy, easier-to-manage and more affordable
> virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/_______________________________________________
> 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




--
Ass: Marcos Côrtes
Mestrando Computação - UFF

-- 
Jomi Fred Hubner
Federal University of Santa Catarina
Department of Automation and Systems Engineering
PO Box 476, Florianópolis, SC
88040-900 Brazil


------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT
space for its ease of implementation, lower cost, and increased
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users