-
Jason team: I have implemented exercise 5 from Section 3.5 in "Programming Multi-agent Systems in AgentSpeak Using Jason" and my solution works fine. But I was just wondering if what I did is considered correct/idiomatic in the Jason/Agentspeak world, and/or if there are better solutions. If anybody can share any comments on the merits of this solution, and any better alternatives it would be much appreciated. supermarket1.asl
supermarket2.asl
robot.asl
This works as expected, based on what values I plug in for beer_price in the respective supermarket definitions. output
My biggest qualm about this is that it uses the two separate plan triggers and is hard-coded to deal with exactly two markets. I feel like there is probably a much cleaner solution that can easily accommodate an arbitrary number of markets, and maybe a way to do all of this without the redundant plan triggers. But I don't see that better solution at first blush. Any tips would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
your solution looks very good for me. I do like your inference rule for best price, exploiting backtracking. for the plans, I guess you can keep just the h2a replacing |
Beta Was this translation helpful? Give feedback.
-
and for a generic cheapest rule, a first draft could be
|
Beta Was this translation helpful? Give feedback.
and for a generic cheapest rule, a first draft could be