From: Jomi H. <jom...@gm...> - 2022-05-12 11:41:32
|
Dear Burak, I wasn’t able to figure out the error that is happening. Is there something more in the error message? (Besides intention could not finish) Anyway, any intention can be suspended and resumed latter. The .wait internal action can be used for that, but also .suspend and .resume. Maybe the idea of commitments can also help you: https://github.com/jason-lang/jason/blob/master/doc/tech/patterns.adoc#commitment HTH, Jomi > On 10 May 2022, at 17:06, Burak Karaduman <bbu...@gm...> wrote: > > Dear all, > > I have an agent code which is as follows: > > > +!color(red,ID) : color(red,ID2) & (ID-ID2)<2 & not ID == ID2 <- push(ID,ID2); mediumPress; .print("A"); .print("Pushing:",red," ",red); -color(_,ID)[source(_)]; -color(_,ID2)[source(_)]. > > +!color(red,ID) : color(_,ID2) & (ID-ID2)<2 & not ID == ID2 <- reject(ID2); ejectProduct; .print("B"); -color(_,ID2)[source(_)]. > > +!color(OC,ID) : color(red,ID2) & (ID-ID2)<2 & not ID == ID2<- push(ID,ID2);.print("C"); mediumPress; .print("Pushing:",OC," ",red); -color(_,ID)[source(_)]; -color(_,ID2)[source(_)]. > > +!color(OC,ID) : color(OC,ID2) & (ID-ID2)<2 & not ID == ID2 <- push(ID,ID2);.print("D"); mediumPress; .print("Pushing:",OC," ",OC); -color(_,ID)[source(_)]; -color(_,ID2)[source(_)]. > > +!color(OC,ID) : color(OC2,ID2) & not OC==OC2 & (ID-ID2)<2 & not ID == ID2 <- .print("E"); reject(ID2); ejectProduct; -color(_,ID2)[source(_)]. > > The code runs well with a textual environment because the occurrence of the events is quite frequent. Therefore, the next contextual change happens right after the completion of the previous event. The planning mechanism is simple, various consecutive products which have IDs keep coming and the agent is trying to match these products according to their colours. It also uses IDs for comparison because agents run so fast to generate the same event (i.e same products with the same IDs). > > However, when I deploy this code to a physical system I get an "Intention could not finish" error, the occurrence of events can have long time periods because of the physical environment. For example product red with ID 0 is generated, then product blue with ID 1 can be generated after 2 minutes or hours. Is it possible to define a timeout for the intention? Or is it possible to await it forever etc? > > Best regards. > > > -- > Burak KARADUMAN, > Ph.D. Student at the University of Antwerp & Flanders Make, > Modeling Intelligent Complex Software & Systems (MICSS-Lab), > G236, Department of Computer Science, Faculty of Science, Campus Middelheim, > Middelheimlaan 1, 2020 Antwerp, Belgium > > _______________________________________________ > Jason-users mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-users |