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.

Source Distribution (107.2 kB view hashes)

Uploaded source

Built Distributions

ecspy-0.6.win32.exe (232.7 kB view hashes)

Uploaded 2 6

ecspy-0.6-py2.6.egg (75.4 kB view hashes)

Uploaded 2 6

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page