#!/usr/local/dist/bin/perl
#
# Zufaellige Kommunikationsmatrix erzeugen
# Knoten Gewichte g zuweisen -> g * g'


$count = <>;   #Anzahl der Knoten
chomp($count);

# die Werte sind in MBit/s ... sinnvoll sind zwischen 0.1 und 15
# ??? sicher bin ich mir nicht ... momentan alles hochskaliert!
for($i = 0; $i < $count; $i++) {
  $g[$i] = log(rand) * (-110);  # * (-1.3)
#  $g[$i] = $g[$i] > 15 ? 15 : $g[$i];
  #print "$g[$i] \n";
}

# print  g * g'

for($i = 0; $i < $count; $i++) {
  for($j = 0; $j < $count; $j++) {
    $val = int(100 * sqrt($g[$i] * $g[$j])) / 100.0;
    print "$val ";
  }
  print "\n";
}
