SandBox

ShscWiki :: LogIn :: PageIndex :: RecentChanges
This is the sandbox where you can play with wiki markup.

 Table of content 


Please be noting the following german smilies:


A quote consisting of blocks!


Test

text

Toast

text

Butts

text

Boners

text

Dongs


^^^ look a line

Taters

text
#!/usr/bin/perl use warnings; use strict; # setup my $bits = 32; my $granularity = 2 ** $bits - 1; my $iterations = 50; my $population_size = 300; my @searchspace = (0..15); my $mutation_probability = 0.01; output_tidy(); # generate initial population of size $population_size my @population = (); for (0..$population_size) { # get a random value 0 => 1 and encode by scaling to codespace my $val = rand(); push(@population, int $val * $granularity); } # generate search space variables to help codespace <=> searchspace conversion # min, max and range my $min_ss = $searchspace[0]; my $max_ss = (reverse @searchspace)[0]; my $ran_ss = $max_ss - $min_ss; my $i = 0; # output generation zero output(\@population, $i); while ($i < $iterations) { # sort population using fitness function my @sorted_population = sort fitness_function @population; # create new population my @new_population = (); # fill the new population using select_and_crossover foreach (0..$population_size) { push(@new_population, select_and_crossover(\@population)); } # mutate the new population @new_population = mutate(\@new_population); @population = @new_population; printf("generation: %d / %d\n", $i, $iterations); $i++; output(\@population, $i); } #blah


gfddffgfddddd
does this work what does this look like inline I sure hope so
gfgfdgfdgfdgdfgd


Iñtërnâtiônàlizætiøn
Iñtërnâtiônàlizætiøn

http://shsc.info

This article is ©2008 by the respective authors. Reproduction is prohibited without express permission from all contributors.