IDK kohtumine kaugõppijatega Prof Kuldar Taveter, Tallinna Tehnikaülikool
Kohtumise kava Moodle probleemid Miniprojektide teemad ja küsimused Jason
Moodle probleemid Foorumid Jagatud failid
Miniprojektide teemad ja küsimused
BDI agent architecture
The execution loop of a basic BDI reasoner while there are unachieved goals do observe the environment; update beliefs; prioritise intentions to achieve; choose a plan for the intention; execute and monitor the plan; end while
An agent programmed in Jason Set of beliefs Set of plans Goals Events
Events in Jason A change of an agent’s beliefs through perception of the environment: denoted by +belief or –belief A change in the agent’s goals: denoted by +!goal or –!goal
The general pattern for representing Jason plans event : context -> body;
Actions in Jason Standard internal actions starting with ‘.’: for example,.print("I'm not happy!"); Adding a goal: !goal, for example, !givePresent(H); Removing a goal: -!goal, for example, -!play(Friend); Evaluating a predicate: ?predicate, for example ?happyLevel(K); Replacing a belief: -+predicate, for example, -+presentList(T);
An agent behaviour model of a Tamagotchi revisited
Knowledge base happyLevel(0). myFriend(tamagotchi2). myMaster(person). !checkHappyLevel. presentNumber(2). presentList([toy,candy]).
Checking happiness +!checkHappyLevel: happyLevel(M) & M <=20 <-.print("I'm not happy!");.my_name(I); ?happyLevel(K); ?myMaster(P);.send(P, tell, unhappy(I,K)).
Requesting +visitFriend: true <-.print("Could I come to your place?"); ?myFriend(Friend);.my_name(I);.send(Friend, tell, could_I_come_to_your_place(I)).
Receiving acceptance/sending +please_come(P): true <-.print("Good day!");.my_name(I); ?myFriend(Friend);.send(Friend, tell, good_day(I)).
Receiving +hello(Friend): true <- !visit(Friend).
Setting the goals for sending a present or +!visit(Friend): presentNumber(M) & M >0 <- ?presentList([H|T]); -+presentList(T); +!visit(Friend): presentNumber(M) & M =0 <- !play(Friend).
Sending a +!givePresent(Present): true <- ?happyLevel(L);.print("Please accept my present,",Present,"!(",L,")"); ?presentNumber(N); -+presentNumber(N -1); -+happyLevel(L + 4); ?myFriend(Friend);.my_name(I);.send(Friend,tell,accept_my_present(I, Present)).
Requesting to +!play(Friend): happyLevel(M) & M <=20 <-.print("May I play with you,",Friend,"?(",M,")");.my_name(I);.send(Friend,tell,play_with_me(I,M)).
Thanking for the +thanks(Friend,Present): true <- !play(Friend).
Receiving +ok(Friend,M): happyLevel(M) & M <=20 <- ?happyLevel(L); -+happyLevel(L + 2); !visit(Friend).
Jason in action
Ülesanne Laadige alla Jason aadressilt Looge kaks Jasoni agenti, mis tervitavad teineteist. Püüdke järgida tervitamise mudeleid.
Greeting Goal Model
Greeting Role Model Greetee: To be greeted by greeter Responsibilities: To be noticed by greeter; To perceive greeting Constraints: None Greeter: To greet another agent coming within environment Responsibilities: To notice greetee; To formulate greeting; To articulate greeting Constraints: Articulation within 10 seconds of noticing; Formulation must be appropriate to greetee + environment Evaluator: To evaluate the greeting Responsibilities: To observe greeting; To evaluate greeting; To publish report Constraints: timeliness
Combined behaviour and interaction model for greeting