Skip to main content

Evolutionary Computations in Python

Project description

ECsPy (Evolutionary Computations in Python) is a free, open source framework for creating evolutionary computations in Python. Additionally, ECsPy provides an easy-to-use canonical genetic algorithm (GA), evolution strategy (ES), estimation of distribution algorithm (EDA), differential evolution algorithm (DEA), and particle swarm optimizer (PSO) for users who don’t need much customization. Please see the full documentation for more information.

Usage Example

from random import Random
from time import time
from ecspy import ec
from ecspy import terminators
from ecspy import observers

def generate_binary(random, args):
    bits = args.get('num_bits', 8)
    return [random.choice([0, 1]) for i in xrange(bits)]

def evaluate_binary(candidates, args):
    fitness = []
    base = args.get('base', 2)
    for cand in candidates:
        num = 0
        exp = len(cand) - 1
        for c in cand:
            num += c * (base ** exp)
            exp -= 1
    return fitness

rand = Random()
ga = ec.GA(rand) = observers.screen_observer
ga.terminator = terminators.evaluation_termination
final_population = ga.evolve(evaluator=evaluate_binary,
for individual in final_population:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ecspy, version 0.7
Filename, size File type Python version Upload date Hashes
Filename, size ecspy-0.7-py2.6.egg (115.8 kB) File type Egg Python version 2.6 Upload date Hashes View
Filename, size ecspy-0.7.win32.exe (249.1 kB) File type Windows Installer Python version 2.6 Upload date Hashes View
Filename, size (126.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page