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
        fitness.append(num)
    return fitness

rand = Random()
rand.seed(int(time()))
ga = ec.GA(rand)
ga.observer = observers.screen_observer
ga.terminator = terminators.evaluation_termination
final_population = ga.evolve(evaluator=evaluate_binary,
                             generator=generate_binary,
                             max_evaluations=1000,
                             num_elites=1,
                             pop_size=100,
                             num_bits=10)
for individual in final_population:
    print(individual)

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

ecspy-0.7.zip (126.0 kB view details)

Uploaded Source

Built Distributions

ecspy-0.7.win32.exe (249.1 kB view details)

Uploaded Source

ecspy-0.7-py2.6.egg (115.8 kB view details)

Uploaded Source

File details

Details for the file ecspy-0.7.zip.

File metadata

  • Download URL: ecspy-0.7.zip
  • Upload date:
  • Size: 126.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ecspy-0.7.zip
Algorithm Hash digest
SHA256 cb6ce533091e99ef92f61aa70b824453215d0c192c33dbb91a45d7fcf1d83f4b
MD5 79732d9a07204edfd0a4b1cea4a9e74e
BLAKE2b-256 5dd980df7344aa61c60b984ee082e518b69f977fe09e1cdc7e605aae0914628c

See more details on using hashes here.

File details

Details for the file ecspy-0.7.win32.exe.

File metadata

  • Download URL: ecspy-0.7.win32.exe
  • Upload date:
  • Size: 249.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ecspy-0.7.win32.exe
Algorithm Hash digest
SHA256 fefc03fb0451c8420a98c400add84a388a6bd11e70a73ffaa46f032409c2a8f1
MD5 73764e7bcc87546384180da8de17c587
BLAKE2b-256 2e9261a7627af1c1cfbcca8a6ce1f281524fc3301c24535a8c18f1ad68433a5e

See more details on using hashes here.

File details

Details for the file ecspy-0.7-py2.6.egg.

File metadata

  • Download URL: ecspy-0.7-py2.6.egg
  • Upload date:
  • Size: 115.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ecspy-0.7-py2.6.egg
Algorithm Hash digest
SHA256 57613db3449f6e150b26a3fc163419ec63ac40389188c9762ea5c88d7bf7c027
MD5 e2cd79c7953022e9e2d8ed2b1c0e93ce
BLAKE2b-256 d41f415b0bd35d27b5e9811543a4ead70d6be8bca92b1a21ea8240878a0940ca

See more details on using hashes here.

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