PHP Classes
elePHPant
Icontem

Simple Genetic Algorithm: Implement genetic algorithm to optimize population

Recommend this page to a friend!
  Info   View files Example   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2015-02-10 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 158 This week: 1All time: 8,124 This week: 1,047Up
Version License PHP version Categories
simple-genetic 1.0.3MIT/X Consortium ...5.5Algorithms, PHP 5, Artificial intelli...
Description Author

This class implements a genetic algorithm to optimize a population of chromosomes.

It provides a base class that implements several steps of a genetic algorithm like initializing the population, selection, fitness function, cross-over, mutation and get the best sequence.

The class can be extended by specialized sub-classes that override the population initialization or other steps to customize the genetic algorithm to solve specific optimization problems.

Picture of ryan silalahi
Name: ryan silalahi <contact>
Classes: 1 package by
Country: Indonesia Indonesia

Details

SimpleGeneticAlgorithm

simple genetic algorithm in php, this package i create just for example how we can implement Genetic Algorithm in PHP if you inteserted just email me at mr.ryansilalahi@gmail.com :-)

see interface/GeneticAlgorithm.php

Installation

you can download this with composer (packagist) <pre><code>composer require ryanhs/simple-genetic-algorithm</code></pre>

Example

in example dir you can see:

  • example1.php
  • example2.php
  • example3.php

example 1

<pre><code> require '/vendor/autoload.php'; // composer autoload

$ga = new \SimpleGeneticAlgorithm\SimpleGeneticAlgorithm(array(

'mutation' => 25, // 25%
'goal' => 'Astari Ghaniarti',

'delay' => 50, // ms, if debug is false, then delay forced to 0
'debug' => true,

));

$ga->run(); // just run because debug is true </code></pre>

License

MIT License

		
  Files folder image Files  
File Role Description
Files folder imageexample (4 files)
Files folder imageinterface (1 file)
Files folder imagetest (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data
Plain text file SimpleGeneticAlgorithm.php Class Class source

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file example1.php Example Example script
  Accessible without login Plain text file example2.php Example Example script
  Accessible without login Plain text file example3.php Example Example script
  Accessible without login Plain text file example4.php Example Example script

  Files folder image Files  /  interface  
File Role Description
  Plain text file GeneticAlgorithm.php Class Class source

  Files folder image Files  /  test  
File Role Description
  Accessible without login Plain text file Test.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:158
This week:1
All time:8,124
This week:1,047Up