예제 #1
0
 public function testSetGetFittestIndividual()
 {
     $pop = new Population(50, '12345');
     $individual = new Individual();
     $individual->setString('HELLO');
     $pop->setIndividual(25, $individual);
     $this->assertEquals('HELLO', $pop->getFittest('HELLO')->__toString());
 }
예제 #2
0
 public function testMutation()
 {
     $individual = new Individual();
     $individual->setString('Jurgen Smurgen');
     $individual->mutate();
     $this->assertNotEquals('Jurgen Smurgen', $individual->__toString());
 }