[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestTreeRouting parse_tree.pl, NONE, 1.1.2.1 README, 1.1.2.1, 1.1.2.2 TestTreeRoutingP.nc, 1.1.2.1, 1.1.2.2 test.py, 1.1.2.1, 1.1.2.2

Rodrigo Fonseca rfonseca76 at users.sourceforge.net
Tue May 16 15:47:24 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestTreeRouting
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17063

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	README TestTreeRoutingP.nc test.py 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	parse_tree.pl 
Log Message:
Simple test with two roots

--- NEW FILE: parse_tree.pl ---
#!/usr/bin/perl -w

# *Very* simple script to plot the logical structure of the forest generated by the
# tree formation algorithm.
# INPUT: (stdin) tossim debug log
# OUTPUT: (stdout) a ps version of the graph

# The script parses a specific type of debug message in the TreeRouting TOSSIM channel:
# DEBUG (node) ... sendBeaconTask$runTask parent: X hopcount ...
# It then plots the *last* parent seen for each node in the log.
# Requires the installation of the GraphViz perl module (just do >cpan install GraphViz)

# Author: Rodrigo Fonseca

use GraphViz;
$INVALID_ADDR = 65535;

$g = GraphViz->new();

while (<>) {
	chomp;
	if (($child,$parent) = /DEBUG \((\d+)\):.*sendBeaconTask\$runTask parent: (\d+) hopcount/) {
		if ($parent != $INVALID_ADDR) {
			$parent{$child} = $parent;
		}
	} 

}
for $node (keys %parent) {
	$g->add_node($node);
	$g->add_node($parent{$node});
	$g->add_edge($node => $parent{$node});
}
print $g->as_ps;


Index: README
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestTreeRouting/Attic/README,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** README	15 May 2006 16:55:27 -0000	1.1.2.1
--- README	16 May 2006 22:47:21 -0000	1.1.2.2
***************
*** 1,3 ****
! This is a simple configuration and test driver to test tree building and link estimation. Currently to be used in simulation, because it does not have any debugging or state output to the radio.
  
  Rodrigo Fonseca
--- 1,13 ----
! This is a simple configuration and test driver to test tree building and link
! estimation. Currently to be used in simulation, because it does not have any
! debugging or state output to the radio.
! 
! The nesc files just wire and start the tree building, with no data traffic.
! Nodes 0 and 173, when started, are set as roots.
! 
! The python script starts node 173 later, so in the first phase there should be
! one tree and when the node boots, there should be two trees, one rooted at
! 0, the other at 173.
! 
  
  Rodrigo Fonseca

Index: TestTreeRoutingP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestTreeRouting/Attic/TestTreeRoutingP.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** TestTreeRoutingP.nc	15 May 2006 16:55:27 -0000	1.1.2.1
--- TestTreeRoutingP.nc	16 May 2006 22:47:21 -0000	1.1.2.2
***************
*** 5,8 ****
--- 5,9 ----
      uses interface SplitControl as RadioControl;
      uses interface RootControl;
+     uses interface Timer;
  }
  implementation {
***************
*** 11,15 ****
          call RadioControl.start();
          call TreeControl.start();
!         if (TOS_NODE_ID == 0) {
              call RootControl.setRoot();
          }
--- 12,16 ----
          call RadioControl.start();
          call TreeControl.start();
!         if (TOS_NODE_ID == 0 || TOS_NODE_ID == 173) {
              call RootControl.setRoot();
          }

Index: test.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestTreeRouting/Attic/test.py,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** test.py	15 May 2006 16:55:27 -0000	1.1.2.1
--- test.py	16 May 2006 22:47:21 -0000	1.1.2.2
***************
*** 15,19 ****
  t.addChannel("TreeRouting", sys.stdout);
  t.addChannel("TreeRoutingCtl", sys.stdout);
! #t.addChannel("LI", sys.stdout);
  #t.addChannel("Gain", sys.stdout);
  #t.addChannel("TossimPacketModelC", sys.stdout);
--- 15,19 ----
  t.addChannel("TreeRouting", sys.stdout);
  t.addChannel("TreeRoutingCtl", sys.stdout);
! t.addChannel("LI", sys.stdout);
  #t.addChannel("Gain", sys.stdout);
  #t.addChannel("TossimPacketModelC", sys.stdout);
***************
*** 31,39 ****
        r.setNoise(int(s[1]), float(s[2]), float(s[3]))
  
! for i in range(0, 2):
    m = t.getNode(i);
!   m.bootAtTime((t.ticksPerSecond() / 50) * i + 43);
   
  while (t.time() / t.ticksPerSecond() < 1600):
    t.runNextEvent()
    
--- 31,44 ----
        r.setNoise(int(s[1]), float(s[2]), float(s[3]))
  
! for i in range(0, 225):
    m = t.getNode(i);
!   if (i == 173):
!     m.bootAtTime(t.ticksPerSecond() * 100) 
!   else:
!     m.bootAtTime((t.ticksPerSecond() / 50) * i + 43);
   
  while (t.time() / t.ticksPerSecond() < 1600):
+   if (t.time() == t.ticksPerSecond() * 100):
+     print "---------"
    t.runNextEvent()
    



More information about the Tinyos-2-commits mailing list