ECsPy

Evolutionary Computations in Python
Download

ECsPy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Aaron Garrett
  • Publisher web site:
  • http://code.google.com/u/aaron.lee.garrett/

ECsPy Tags


ECsPy Description

Evolutionary Computations in Python ECsPy is a free and open source framework for creating evolutionary computations in Python. Additionally, ECsPy provides an easy-to-use canonical genetic algorithm (GA), evolution strategy (ES), and particle swarm optimizer (PSO) for users who don't need much customization.BackgroundAn extensive background on evolutionary computation, including references to the relevant academic literature, can be found in the Project Wiki. You can also find a great deal of information from the Wikipedia links on the right.Package StructureECsPy consists of the following 6 modules:* ec.py -- provides the basic framework for the Evolution Engine and specific ECs* observers.py -- defines a few built-in (screen and file) observers* replacers.py -- defines standard replacement schemes such as generational and steady-state replacement* selectors.py -- defines standard selectors (e.g., tournament)* terminators.py -- defines standard terminators (e.g., exceeding a maximum number of generations)* variators.py -- defines standard variators (crossover and mutation schemes such as n-point crossover) ExampleThe following example illustrates the basics of the ECsPy package. Additional examples can be found under the Examples wiki.from random import Randomfrom time import timefrom ecspy import ecfrom ecspy import terminatorsfrom ecspy import observersdef generate_binary(random, args): try: bits = args except KeyError: bits = 8 return ) for i in xrange(bits)] def evaluate_binary(candidates, args): fitness = [] try: base = args except KeyError: 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 fitnessrand = Random()rand.seed(int(time()))ga = ec.GA(rand)ga.observer = observers.screen_observerfinal_pop = ga.evolve(evaluator=evaluate_binary, generator=generate_binary, terminator=terminators.fun_eval_termination, max_fun_evals=1000, num_elites=1, pop_size=100, num_bits=10)for ind in final_pop: print(str(ind)) Requirements: · Python


ECsPy Related Software