Skip to content

PMASIAUJ - Section 3.5, Exercise 1 question #111

Answered by jomifred
mindcrime asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I think your solution is reasonable considering the overall application: the owner has to decide about its beers :-). So it seems ok for the robot to delegate this decision to the owner. In your code the owner always accepts the suggestion of the robot, but it could be different.

However, considering just AgentSpeak and your question, we can program the plan for has(owner,beer) using the or operator for two sources:

+!has(owner,beer)[source(A)] : A == owner | A == self .......

or

trust(owner).
trust(self).

+!has(owner,beer)[source(A)] : trust(A)[source(self)]  .......

Notice that I wrote trust(A)[source(self)] instead of trust(A). Otherwise, some malicious agent could just .send(ro…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mindcrime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants