From 4633e2fcfdd5c61d915a827c0951fb30b476c315 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Fri, 11 Feb 2011 08:41:40 +0100 Subject: [PATCH] Scripts for manipulating and calculating statistics from .csc files --- tools/csc/csc-compute-neighbor-stats | 54 ++++++++++++++++++++++++++++ tools/csc/csc-create-range-success | 29 +++++++++++++++ 2 files changed, 83 insertions(+) create mode 100755 tools/csc/csc-compute-neighbor-stats create mode 100755 tools/csc/csc-create-range-success diff --git a/tools/csc/csc-compute-neighbor-stats b/tools/csc/csc-compute-neighbor-stats new file mode 100755 index 000000000..4ccaa1461 --- /dev/null +++ b/tools/csc/csc-compute-neighbor-stats @@ -0,0 +1,54 @@ +#!/usr/bin/perl + +$num = 0; +$override_range = $ARGV[0]; + +# Go through the .csc file; find the transmission range and all the +# nodes' x and y coordinates. +while() { + if(/\([\d.]+)\<\//) { + $range = $1; + } + + if(/\([\d.]+)\([\d.]+)\ $csc"); + +while() { + if(m-\[\d.]+\-) { + print O "$range\n"; + } elsif(m-\[\d.]+\-) { + print O "" . ($range * 2) . "\n"; + } elsif(m-\[\d.]+\-) { + print O "$success\n"; + } else { + print O; + } +}