Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2015-02-10 (1 year ago) | | Not enough user ratings | | Total: 158 This week: 1 | | All time: 8,124 This week: 1,047 |
|
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. | |
|
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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.