Examples and Exercises
 
Examples and Exercises from the Book!
 
The best way to learn a new programming language is by trying the examples and doing exercises. We have made the code used in the book for all the examples and exercises available from this page. We will soon have model answers for the exercises too.
 
So why not download Jason and the code below and try the examples yourself!!!
 
 
Chapter 1: Introduction
  1. Hello World: example of AgentSpeak in Section 1.4
  2. Factorial: example of AgentSpeak in Section 1.4
 
Chapter 3: The Jason Agent Programming Language
  1. Domestic Robot: example of AgentSpeak in Section 3.4, also used in exercises
 
Chapter 4: Jason Interpreter
  1. Plan Failure: example of plan failure in Section 4.2
  2. Domestic Robot: used in exercise 3
  3. Atomic Annotation: used in exercise 4
 
Chapter 5: Environments
  1. Vacuum Cleaning: example of environment code in Section 5.1 and used in exercise 1
  2. Domestic Robot: example of environment code in Section 5.2 and used in exercise 2
  3. Room: used in exercise 3
 
Chapter 6: Communication and Interaction
  1. Contract Net Protocol: example of communication in Section 6.3 and used in exercises of this chapter
  2. Domestic Robot: used in exercise 1
 
Chapter 7: User-Defined Components
  1. Internal Action: example of internal action for odd numbers in Section 7.1
  2. Idle Agent: example of agent class customisation in Section 7.2
  3. Vacuum Cleaning: example of agent class customisation in Section 7.2 and agent architecture customisation in Section 7.3
  4. Domestic Robot: example of agent architecture customisation in Section 7.3
  5. Custom Belief Base: example of belief base customisation in Section 7.4
  6. Directives: example of user defined directives in Section 7.5
 
Chapter 9: Case Studies
  1. Case Study I: Gold Miners
  2. Case Study II: Electronic Bookstore
 
All code in one file.
 
 
 
Some comments on possible solutions for the exercises are available here; send us an email asking for the username and password required to access the solutions.