User Tools

Site Tools


contextawaretuples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
contextawaretuples [2010/10/20 17:07]
cfscholl
contextawaretuples [2010/10/20 17:48] (current)
cfscholl
Line 43: Line 43:
 In this case the tuple has type inRoom and one field "MeetingRoom". Being able to read this tuple will indicate that the reader is currently located in the meeting room.  In this case the tuple has type inRoom and one field "MeetingRoom". Being able to read this tuple will indicate that the reader is currently located in the meeting room. 
  
-In order to make sure only those people which are located in the meeting room can read this tuple the injected tuple has a context rule attached. The rule indicates that the reader of the tuple has to have a tuple in his tuple space of type location and the field ?loc has to be within the boundaries of the roomArea. It is only when these conditions are satisfied that a context consumer will be able to read the tuple.+In order to make sure that only those devices which are located in the meeting room can read this tuple the injected tuple has a context rule attached. This rule indicates that the reader of the tuple has to have a tuple in his local tuple space of type location and the field ?loc has to be within the boundaries of the roomArea. It is only when these conditions are satisfied that a context consumer will be able to read the tuple.
  
 <code> <code>
Line 50: Line 50:
 [Tuple(location , ?loc), WithinBoundary(roomArea , ?loc)]; [Tuple(location , ?loc), WithinBoundary(roomArea , ?loc)];
 </code> </code>
- 
- 
  
 ==== Context Consumer ==== ==== Context Consumer ====
 +Because the context provider specifies the rules in order to read its tuples the code for the context consumer is very easy.
 +The context consumer only has to read a tuple of type inRoom and register a listener for when such a tuple is read. In this case the listener will simply print that the user is currently in a particular room. The programmer can also react on the disappearance of a tuple by registering an outOfContext listener. In this case the listener will simply print that the user has move out of the room.
  
 <code> <code>
 def cat := makeCatSystem(); def cat := makeCatSystem();
-cat.whenever: tuple(inRoom , ?name) read:+cat.whenever: Tuple(inRoom , ?name) read:
      display("You are in room " + name);      display("You are in room " + name);
 } outOfContext: } outOfContext:
Line 67: Line 67:
  
 **Context-Aware Tuples for the Ambient**, C. Scholliers, E. Gonzalez Boix, W. De Meuter, T. D'Hondt. In Proceeding of **Context-Aware Tuples for the Ambient**, C. Scholliers, E. Gonzalez Boix, W. De Meuter, T. D'Hondt. In Proceeding of
-the 12th International Symposium on Distributed Objects, Middleware, and Applications (DOA'10), LNCS. Srpinger Verlang, October 2010. ([[ http://prog.vub.ac.be/Publications/2010/vub-tr-soft-10-19.pdf | pdf]])+the 12th International Symposium on Distributed Objects, Middleware, and Applications (DOA'10), LNCS. Springer Verlang, October 2010. ([[ http://prog.vub.ac.be/Publications/2010/vub-tr-soft-10-19.pdf | pdf]])
contextawaretuples.1287587274.txt.gz ยท Last modified: 2010/10/20 17:08 (external edit)