X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=images%2Fmarkov-comparators-to-percent.px;fp=images%2Fmarkov-comparators-to-percent.px;h=f34f18b2f75a4af6d47c3e32748802050ffa0cd7;hb=5a6412eb1c77a88b65cff51830595ad5575fd987;hp=0000000000000000000000000000000000000000;hpb=461b195a7aec442b519e401b07c0faa8ff99f6a9;p=diplomarbeit.git diff --git a/images/markov-comparators-to-percent.px b/images/markov-comparators-to-percent.px new file mode 100755 index 0000000..f34f18b --- /dev/null +++ b/images/markov-comparators-to-percent.px @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $iterations = 0; +my $comparators = 0; +my %data = (); + +while (<>) +{ + chomp; + my ($x, $y) = split; + + $iterations += $y; + $comparators += ($x * $y); + $data{$x} = $y; +} + +print "# Iterations: $iterations\n"; +printf "# Average: %.6f\n", $comparators / $iterations; +for (sort { $a <=> $b } (keys %data)) +{ + printf "%-4i %.6f\n", $_, 100.0 * $data{$_} / $iterations; +}