public function testCull()
 {
     $pop = new Population(5, '12345');
     $pop->mate();
     $pop->cull();
     $this->assertEquals(5, $pop->getSize());
 }
Exemple #2
0
<?php

require_once __DIR__ . '/bootstrap.php';
use NaHelloWorld\Population;
$pop = new Population(10, 'Hello World');
while (true) {
    $pop->nextGeneration();
}