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    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 233 All time: 7,961 This week: 312Up
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
Age: ???
All time rank: 394470 in Indonesia Indonesia
Week rank: 616 Up13 in Indonesia Indonesia Up

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:233
This week:0
All time:7,961
This week:312Up

For more information send a message to info at phpclasses dot org.