This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
crime:examples [2007/03/29 22:24] stijnm *Cosmetic |
crime:examples [2007/03/29 23:06] stijnm Updated |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Example Applications ====== | ||
- | The CRIME distribution comes with a suite of example applications, | ||
- | ===== IN/OUT Board ===== | ||
- | The IN/OUT Board is a classic context-aware application proposed by [Dey et al.] during their seminal work on the context toolkit. The IN/OUT Board implemented using CRIME is used to visualise the current location of a user. The said location is expected to be published as a fact to allow applications to adapt their behaviour accordingly. When users are out of reach, the application keeps a record of when the user was last seen by the system. | ||
- | |||
- | <note warning> | ||
- | The CRIME distribution contains a script file inout.sh which launches the IN/OUT Board application which internally starts a CRIME engine. The CRIME engine will evaluate the rules specified below. </ | ||
- | |||
- | ==== The Rules ==== | ||
- | |||
- | The IN/OUT Board consists of an application class which manages the information on which users are located where which is coupled to simple user interface class written in Java. The application also offers a few classes which subclass from the Action class offered by the CRIME engine. These classes can be used in the CRIME rules which specify when the application will be notified of changes in its environment. | ||
- | |||
- | The Action class is an abstract class which expects its subclasses to implement two methods: The method '' | ||
- | |||
- | The rule below triggers the SetBoard action whenever it detects that a particular person (''? | ||
- | |||
- | < | ||
- | : | ||
- | person(? | ||
- | location(? | ||
- | </ | ||
- | |||
- | As described in the original paper by [Dey et al.], variations in the functionality of the IN/OUT Board can be conceived where some versions may also display the last known whereabouts of a particular user on the screen. This can be achieved using the '' | ||
- | < | ||
- | : | ||
- | ?name, ?room, ?phone, ?time) :- | ||
- | history(? | ||
- | </ | ||
- | |||
- | < | ||
- | In the code snippets given above, the action names are fully qualified. The distribution of CRIME does however allow one to | ||
- | specify the scope of these rules as follows: '' | ||
- | </ |