From: Burak K. <bbu...@gm...> - 2022-05-12 21:16:58
|
Hi Jomi, Thank you for your reply. Let me summarize the story for you, *+!color(red,ID) : color(red,ID2) .....* For example, a sensor reads the colours of the incoming bricks. The first brick is red and has the ID 0, then this creates a belief addition as the head of the plan shows. { *+!color(red,ID) *}. Then, the second brick comes after 5 minutes, which is red and id is 1. In this case, this context matching should be triggered {*+!color(red,ID) : color(red,ID2) & (ID-ID2)<2 & not ID == ID2}* However, until the arrival of the second red brick, I think an implicit timeout mechanism is self-triggered and kills the intention by giving ''the intention could not finish error''. If that timeout was disabled, then it could work and wait until the occurrence of the next event. Maybe a blind commitment pattern is suitable. But, for this kind of work, I should be able to disable this timeout easily. I think I have already tried .wait commands. The intention should not be frozen, but patient enough for the next events. This code works on the computer without any environment, but when I deploy the code onto a system of course physical events do not happen that often. Best regards. Jomi Hubner <jom...@gm...>, 12 May 2022 Per, 13:41 tarihinde şunu yazdı: > 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 > > -- *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 |