#!/usr/bin/perl


# A really quickly-thrown-together script written to generate a graph that
# plots the percentage of data points used in the map vs. the selected
# granularity.

$filename = shift @ARGV;

for ($i = 0; $i < 100; $i++) {
	$output = `sh genmap.sh $filename $i 2>&1`;
	$pointsin = $output;
	$pointsout = $output;
	$pointsin =~ s/([0-9]*) points given, ([0-9]*).*/$1/;
	$pointsout =~ s/([0-9]*) points given, ([0-9]*).*/$2/;
	chomp($pointsin);
	chomp($pointsout);
	$pct= $pointsout / $pointsin * 100;
	print "$i\t$pct\n";
}
