#!/usr/bin/perl use strict; use warnings; my $init_popsize=$ARGV[0]-1; my $maxtime=$ARGV[1]; my @age; my @gender; my @weight; my @population = (0..$init_popsize); for my $i(0..$#population){ $age[$i]=int(rand(10)); #Alter my $r1=rand(); if($r1<=0.4){ #Geschlecht (0=männlich, 1=weiblich) $gender[$i]=0; } else{ $gender[$i]=1; } my $r2=rand(); if ($r2<=0.3){ #Gewicht $weight[$i]=0; } elsif ($r2>0.3 && $r2<=0.6){ $weight[$i]=1; } else{ $weight[$i]=2; } printf "$age[$i] $gender[$i] $weight[$i]\n"; } printf "\n";