Is this a bug in Jason??

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

Is this a bug in Jason??

Omar Chiyean
Hi there..

I have an issue on Jason 1.3.2 with the .wait  primitive.

I have one agent with the next plan...
(the plans and the agent are just for probing...)

/* Initial goals */
!start.

/* Plans */

+!start: true <-
    for (.member(Xi,["hola", "hello", "bonjour", "hi"])){
        !getData(Xi, Algo);
        .wait("+idone(listo, Z)");
    }
    .print(Z);
    -idone(_,_).
   

+!getData(X, Algo): true <-
    .print("getData recibio: ", X);
    .concat ( "getData te envia lo que llego: ", X, M);
    +idone(listo, M).   
   
For some reason, the event +idone never triggers .wait primitive and the agent get into a cycle.
What could it be happening???

Tnx in advance...
For the record, the way i solve this issue is with a .send(self, tell, idone(listo, M)

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|

Re: Is this a bug in Jason??

Jomi Hubner
Hi Omar, see a possible answer below.

On 18/06/2010, at 01:14, Omar Chiyean wrote:

> Hi there..
>
> I have an issue on Jason 1.3.2 with the .wait  primitive.
>
> I have one agent with the next plan...
> (the plans and the agent are just for probing...)
>
> /* Initial goals */
> !start.
>
> /* Plans */
>
> +!start: true <-
>     for (.member(Xi,["hola", "hello", "bonjour", "hi"])){
>         !getData(Xi, Algo);

the code above will produce the event +idone(...) before the .wait below. When the .wait runs the event is already lost. I guess the solution with .send worked by chance, it is not guaranteed that .wait will run before the arrival of the message.

>         .wait("+idone(listo, Z)");

prefer the new syntax:
        .wait({+idone(listo,Z});
so that the compiler can check the syntax of the argument.

HTH,

Jomi

>     }
>     .print(Z);
>     -idone(_,_).
>    
>
> +!getData(X, Algo): true <-
>     .print("getData recibio: ", X);
>     .concat ( "getData te envia lo que llego: ", X, M);
>     +idone(listo, M).    
>    
> For some reason, the event +idone never triggers .wait primitive and the agent get into a cycle.
> What could it be happening???
>
> Tnx in advance...
> For the record, the way i solve this issue is with a .send(self, tell, idone(listo, M)
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo_______________________________________________
> 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


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users