{ "info": { "author": "Oliver Margetts", "author_email": "oliver.margetts@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering" ], "description": "# Python-TinyEvolver\n### A simple, tiny engine for creating genetic algorithms\n\nTinyEvolver is a framework for creating genetic algorithms written in pure python.\nIt aims to let you write sensible evolutionary algorithms in as few steps as possible\nusing a prototype system to extrapolate generation, mutation and mating of individuals\nfrom a simple example.\n\nTinyEvolver was developed for scientists and researchers who want to utilize genetic\nalgorithms in models and applications, but not necessarily become researchers in\ngenetic/evolutionary algorithms themselves. You define the things that are really\nunique to your problem and TinyEvolver does the rest.\n\nThe source code for TinyEvolver is inspired, at least in part, by the [DEAP](https://github.com/deap/deap)\nmodule, but we've made conscious decisions to tailor our module towards simplicity and lightness.\nBut simple doesn't mean featureless - individuals can have genes of mixed type, populations\ncan be generated on the fly or from old data, and one can evolve many populations at\nonce with multiprocessing. \n\n## Installation\nInstallation requires Python 2.6+ or Python 3.4+.\n\nTo install from source, simply clone into a directory, then from that directory run\n```\npython setup.py install\n```\nor, if you'd prefer to be able to edit the installed code yourself:\n```\npython setup.py develop\n```\n\n## Example\n```python\nfrom tinyevolver import Population\n\nprototype = [False for _ in range(100)]\np = Population(prototype=prototype, gene_bounds=None, fitness_func=sum)\n\np.populate()\np.evolve()\n\nprint(p.best.genes)\n```\n\n## Tips\nThe majority of the work in constructing an evolutionary algorithm in TinyEvolver is the fitness function - and this is where the majority of the work is done by the CPU. You can thus speed up your code by speeding up the fitness function, whether that be by outsourcing to NumPy, writing C extensions, or simply making your function more efficient. Since TinyEvolver is written in pure Python, you could also run it under [PyPy](http://pypy.org/).\n\nThe best way to discover TinyEvolver's features is through the iPython interactive interpreter - you can enter `Foo.` followed by the `tab` key to see possible completions of Foo, and `Foo?` to view its signature and docstrings. \n\n## Documentation\nTinyEvolver contains 3 classes: Individual, Population and IslandModel. A Population is a collection of Individuals and an IslandModel is a collection of Populations - both of these classes have methods for evolving with all variables having sensible defaults.\n\n### Individual\nUsers should not need to create an instance of this class directly.\n\nAttributes: \n- `individual.genes` a 1D-array or flat list of genes.\n- `individual.fitness` the individual's fitness - may or may not be present.\n- `individual.valid` is True only if `individual.fitness` is present. \n\nMethods:\n- Individuals have many of the methods of lists: you can get/set their genes with indices or slices, iterate over them, put them into `len`, copy them, and put them into any other Python function requiring only these.\n\n### Population\nCreate an instance with `Population(prototype, gene_bounds, fitness_func)`, where\n- `prototype` is a flat list of booleans, integers and floats whose types individuals' genes should have (namely boolean, float or integer).\n- `gene_bounds` is either None or a list of lower/upper bounds for the genes.\n- `fitness_func` takes a flat list of genes and returns a numeric value representing the individual's fitness.\n\nAttributes:\n- `population.best` the individual with the highest fitness.\n- `population.individuals` the full list of individuals in the population.\n\nMethods:\n- Populations have many of the methods of lists: you can get/set their individuals with indices or slices, iterate over them, put them into `len`, copy them, or put them into any other Python function requiring only these.\n- `population.populate([popsize, base_population])` if no `base_population` is passed then this will generate the required number of individuals for the population using its `prototype` and `gene_bounds`. If a family of list-like objects is passed as a `base_population` then the population is populated with these instead.\n- `population.evolve([ngen, matepb, mutpb, indpb, scoping, tournsize, verbose])` this should only be called after the class has been populated. It evolves `ngen` generations, where individuals have a probability `matepb` of mating, `mutpb` of mutating. `indpb` controlls the variability of an individual's genes upon mutation. Fitest individuals are selected from random tournaments of size `tournsize`. If `scoping` is positive then the amount by which floats are able to mutate decreases from one generation to the next - honing in upon parameters. Set `verbose` to False to avoid printing details of the evolution.\n\n### IslandModel\nCreate an IslandModel instance with `IslandModel(poplist)` where `poplist` is a list of `Population` objects.\n\nAttributes:\n- `islandmodel.best` the best individual from all the individual populations\n- `islandmodel.islands` a list containg the class' populations\n\nMethods:\n- `islandmodel.amalg_pop()` this returns the islands amalgamated into a single large population\n- `islandmodel.select_pop()` this selects a population from across the islands whose size is that of a single island\n- `islandmodel.evolve([ngen, matepb, mutpb, indpb, scoping, tournsize, verbose, mig_freq])` this evolves all the islands, with individuals migrating between islands every `mig_freq` generations. See the `evolve` method for the `Population` class.\n- `islandmodel.multi_evolve([ngen, matepb, mutpb, indpb, scoping, tournsize, verbose, mig_freq])` this is the same as the `evolve` method, but uses multiprocessing.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/olliemath/Python-TinyEvolver/", "keywords": "genetic,evolution,algorithms,optimization", "license": "GNU GPL V.2", "maintainer": null, "maintainer_email": null, "name": "tinyevolver", "package_url": "https://pypi.org/project/tinyevolver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tinyevolver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/olliemath/Python-TinyEvolver/" }, "release_url": "https://pypi.org/project/tinyevolver/0.1/", "requires_dist": null, "requires_python": null, "summary": "A simple, tiny engine for creating genetic algorithms.", "version": "0.1" }, "last_serial": 1770087, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1922966d38d90ad9a706117e7b14ff45", "sha256": "2574d4005a5ab437ed51b52040b00cc08148bc5958f6054c1b54640cbfd3e24f" }, "downloads": -1, "filename": "tinyevolver-0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "1922966d38d90ad9a706117e7b14ff45", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13119, "upload_time": "2015-10-15T12:31:59", "url": "https://files.pythonhosted.org/packages/97/fc/7fca9830d824987912fb1a6a1de674eed4ae753a7a1725a80f3c6447bc26/tinyevolver-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efe4d044d7bfe43a549fa04eebafa541", "sha256": "1ff913364ccdef0777f9550c94136d516cb86aed8cdd043bf019beaf6f5a9126" }, "downloads": -1, "filename": "tinyevolver-0.1.tar.gz", "has_sig": true, "md5_digest": "efe4d044d7bfe43a549fa04eebafa541", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8556, "upload_time": "2015-10-15T12:32:14", "url": "https://files.pythonhosted.org/packages/9b/f9/9b163f2f7f07f00c1e96e3bb5800642c483b0178bc9987a41d602ded04dd/tinyevolver-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1922966d38d90ad9a706117e7b14ff45", "sha256": "2574d4005a5ab437ed51b52040b00cc08148bc5958f6054c1b54640cbfd3e24f" }, "downloads": -1, "filename": "tinyevolver-0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "1922966d38d90ad9a706117e7b14ff45", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13119, "upload_time": "2015-10-15T12:31:59", "url": "https://files.pythonhosted.org/packages/97/fc/7fca9830d824987912fb1a6a1de674eed4ae753a7a1725a80f3c6447bc26/tinyevolver-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efe4d044d7bfe43a549fa04eebafa541", "sha256": "1ff913364ccdef0777f9550c94136d516cb86aed8cdd043bf019beaf6f5a9126" }, "downloads": -1, "filename": "tinyevolver-0.1.tar.gz", "has_sig": true, "md5_digest": "efe4d044d7bfe43a549fa04eebafa541", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8556, "upload_time": "2015-10-15T12:32:14", "url": "https://files.pythonhosted.org/packages/9b/f9/9b163f2f7f07f00c1e96e3bb5800642c483b0178bc9987a41d602ded04dd/tinyevolver-0.1.tar.gz" } ] }