User Tools

Site Tools


uf:totam

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
uf:totam [2010/10/20 17:17] – Rewriting elisaguf:totam [2010/10/20 17:54] elisag
Line 17: Line 17:
 TOTAM provides the programmer with means to scope the tuples themselves, i.e the tuples can dynamically adjust their scope as they hop from location to location. By means of tuple space descriptors, programmers can scope their tuples preventing them to be propagated to unwanted locations. This scope is determined before the tuple is transmitted, thus allowing the programmer to prevent the physical transportation of tuples to devices which are not targeted.  TOTAM provides the programmer with means to scope the tuples themselves, i.e the tuples can dynamically adjust their scope as they hop from location to location. By means of tuple space descriptors, programmers can scope their tuples preventing them to be propagated to unwanted locations. This scope is determined before the tuple is transmitted, thus allowing the programmer to prevent the physical transportation of tuples to devices which are not targeted. 
  
-{{:research:totamspace.png?480x250|:research:totamspace.png}}+{{:research:totamspace.jpg?481x150|:research:totamspace.jpg}}
  
 Figure above illustrates how a scoped tuple is propagated through the TOTAM network. It depicts two types of locations, the blue and red locations corresponding to two teams of a multi-player game scenario where users (blue team) can use their PDA’s to chase dangerous (virtual) gangsters (red team) in the outdoors. The scope of the propagated tuple has been limited to blue locations. Figure (a) illustrates that a tuple is injected from the location with a star. This location is connected to four blue locations and one red location. As the scope of the tuple is limited to blue locations the tuple is only sent to the four blue locations. From those four locations the tuple is transitively propagated obeying the scope of the tuple until all connected blue locations are reached without being transmitted to a red location. Note that one blue location is not transitively connected to the sending device and thus does not receive the tuple. Figure (b) illustrates that a blue location moved into the range of the isolated blue location and thus, transmits the tuple to it. Again the tuple is not transmitted to nearby red locations. It is important to note from this operational sketch that the first isolated location receives a tuple without being connected at any time with the start location in which the tuple was originally inserted. Figure above illustrates how a scoped tuple is propagated through the TOTAM network. It depicts two types of locations, the blue and red locations corresponding to two teams of a multi-player game scenario where users (blue team) can use their PDA’s to chase dangerous (virtual) gangsters (red team) in the outdoors. The scope of the propagated tuple has been limited to blue locations. Figure (a) illustrates that a tuple is injected from the location with a star. This location is connected to four blue locations and one red location. As the scope of the tuple is limited to blue locations the tuple is only sent to the four blue locations. From those four locations the tuple is transitively propagated obeying the scope of the tuple until all connected blue locations are reached without being transmitted to a red location. Note that one blue location is not transitively connected to the sending device and thus does not receive the tuple. Figure (b) illustrates that a blue location moved into the range of the isolated blue location and thus, transmits the tuple to it. Again the tuple is not transmitted to nearby red locations. It is important to note from this operational sketch that the first isolated location receives a tuple without being connected at any time with the start location in which the tuple was originally inserted.
  
-==== API ====+===== API =====
  
 +TOTAM has been implemented in AmbientTalk. The system library shipped with AmbientTalk contains the TOTAM implementation under at/lang/totam.at.
  
-===== Further Reading ===== 
  
-**TOTAM: Scoped Tuples for the Ambient**C. Scholliers, E. Gonzalez Boix, W. De Meuter. Proceedings of the Second International DisCoTec Workshop on Context-aware Adaptation Mechanisms for Pervasive and Ubiquitous Services (CAMPUS 2009), from Electronic Communications of the EASST, eds. 2009.  +In order to use TOTAM, you need to load the library and create a TOTAM tuple space as follows:
-([[ http://prog.vub.ac.be/Publications/2009/vub-prog-tr-09-07.pdf | pdf]])+
  
 +<code>
 +import /.at.lang.totam;
 +def myTupleSpace := makeTupleSpace();
 +</code> 
  
 +A description can be passed in the ''makeTupleSpace'' operation in order to activate the scoping mechanism (as we will explain later).  To create a tuple or a template, the tuple operation can be used as follows:
 +<code> 
 +// a “hallo” message tuple from wolf.
 +def halloTuple := tuple: [Message, “wolf”, “hallo”];
 +// a template for message tuples from wolf.
 +def wolfTuples := tuple: [Message, “wolf”, var: `content];
 +// a template for any message tuples.
 +def msgTuples := tuple: [Message, var: `from, var: `content];
 +</code>
  
 +TOTAM provides operations to add and read tuples from the tuple space as follows:
 +
 +<code>
 +// add tuple to tuple space
 +myTupleSpace.out(halloTuple);
 +// get a Message tuple
 +def aMessageTuple := myTupleSpace.rdp(msgTuples);
 +// get all Message tuples.
 +def messageTuples := myTupleSpace.rdg(msgTuples);
 +</code>
 +
 +The ''rdp(template)'' and ''rdg(template)'' operations return a tuple or all tuples matching the template in the tuple space if present (without removing), respectively. 
 +Note that these operations are non-blocking. The'' out(tuple)'' operation to insert a private tuple in the tuple space. In order for applications to insert a public tuple, thereby making it available to other collocated TOTAM systems, the'' inject:'' operation is provided.
 +
 +<code>
 +myTupleSpace.goOnline(); 
 +myTupleSpace.inject: halloTuple;
 +</code>
 +
 +Note that the network facilities are disabled by default, so before injecting something in the network, the ''goOnline()'' method must be called on the tuple space.
 +
 +A tuple injected to the network carries the following default propagation protocol.
 +
 +<code>
 +def defaultPropagationProtocol(){
 +  isolate: {
 +    //receiver-side protocol
 +    def decideEnter(ts) { true };
 +    def doAction(ts){};
 +    def changeTupleContent(ts){self};
 +    def decideStore(ts) {true};
 +    //sender-side protocol
 +    def inScope(descriptor){ true };
 +    def decideDie(ts){false};
 +  };
 +};
 +</code>
 +
 +However, other propagation protocols can be created and attached to a tuple before being injected in the network as follows:
 +
 +<code>
 +//define a new propagation protocol
 +def blueProtocol := propagationProtocol: {
 +  def inScope(descriptor) { descriptor.team == "blue" };
 +};
 +// attach the protocol to a tuple
 +def aBlueTuple := tuple: [Message, "hallo"
 +withPropagationProtocol: blueProtocol};
 +// inject the tuple to the network
 +def publication := inject: aBlueTuple;
 +</code>
 +
 +The ''propagationProtocol:'' operation creates a propagation protocol object which extends the default propagation protocol object with other semantics. this sample code shows a protocol based on the operational sketch figure that checks whether the receiver of the tuple is part of the blue team. This is attached to the tuple by means of the ''tuple:withPropagationProtocol:'' operation which is then injected into the network. The inject: operation returns a publication object which can be used as follows to remove the tuple from the network.
 +
 +<code>
 +// sends an antituple to notify the removal of this tuple.
 +publication.retract();
 +</code>
 +
 +In order to notify the removal of a tuple, TOTAM sends an antituple for the removed tuple. For every tuple there is (conceptually) a unique antituple with the same format and content, but with a different sign. All tuples injected by an application have positive sign while their antituples have a negative sign. Whenever a tuple and its antituple are stored in the same tuple space, they immediately annihilate one another, i.e. they both get removed from the tuple space. By means of antituples, TOTAM can “unsend” tuples injected to the network.
 +
 +
 +
 +
 +
 +
 +
 +
 +===== Further Reading =====
 +
 +**TOTAM: Scoped Tuples for the Ambient**, C. Scholliers, E. Gonzalez Boix, W. De Meuter. Proceedings of the Second International DisCoTec Workshop on Context-aware Adaptation Mechanisms for Pervasive and Ubiquitous Services (CAMPUS 2009), from Electronic Communications of the EASST, eds. 2009. 
 +([[ http://prog.vub.ac.be/Publications/2009/vub-prog-tr-09-07.pdf | pdf]])
uf/totam.txt · Last modified: 2021/09/24 10:49 by elisag